0

My application uses both public and private github 3rd party dependencies, I am trying to build my application within docker container with endly(https://github.com/viant/endly),

When I run endly -r=app, I am seeing the following issue: Cloning into '/tmp/go/src/github.com/xxxx/private_repo'... remote: Invalid username or password.

How do I specify private repo credentials, for security reasons I do not want to hardcode raw credentials anywhere.

app.yaml

defaults:
 version: 1.1
  app: myapp
  sdk: go:1.9
pipeline:
  build:
    workflow: app/docker/build
    origin:
      URL: ./../
      credentials: localhost
    buildPath: /tmp/go/src/github.com/myapp
    commands:
      - export GOPATH=/tmp/go
      - cd $buildPath/myapp
      - go get -u .
      - export CGO_ENABLED=0
      - go build -o $app
      - chmod +x $app
    download:
      /$buildPath/${app}: $releasePath
kyle-la
  • 11
  • 1

1 Answers1

0

Endly uses encrypted credentials to deal with secrets, it also obfuscate entry in stdout and logs.

In your build the private auth takes place after go get -u ., so make sure your add the following:

  1. export GIT_TERMINAL_PROMPT=1 to prompt auth on terminal
  2. add secrets nodes with i.e github key and reference entry in ~/.secret/
  3. add optional terminal credential input:

    • $output:/Username/? ${github.username}
    • $output:/Password/? ${github.password}

@app.yaml

defaults:
version: 1.1
  app: myapp
  sdk: go:1.9
pipeline:
  build:
    workflow: app/docker/build
    origin:
      URL: ./../
      credentials: localhost
    buildPath: /tmp/go/src/github.com/myapp
    secrets:
      github: git #loads ~/.secet/git.json with encrypted credentials.
    commands:
      - export GOPATH=/tmp/go
      - cd $buildPath/myapp
      - export GIT_TERMINAL_PROMPT=1
      - go get -u .
      - $output:/Username/? ${github.username}
      - $output:/Password/? ${github.password}
      - export CGO_ENABLED=0
      - go build -o $app
      - chmod +x $app
    download:
      /$buildPath/${app}: $releasePath

Use the following to see more about secret

terry.zhao
  • 29
  • 1
  • 2