Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build from private repository #955

Closed
lizzzcai opened this issue Dec 6, 2021 · 4 comments
Closed

Fail to build from private repository #955

lizzzcai opened this issue Dec 6, 2021 · 4 comments

Comments

@lizzzcai
Copy link

lizzzcai commented Dec 6, 2021

Hi, I try to build from a private GitHub repo but facing some errors in taskrun.

below are my YAML:

apiVersion: shipwright.io/v1alpha1
kind: Build
metadata:
  name: buildpack-go-build
  annotations:
    build.shipwright.io/verify.repository: "true"
spec:
  source:
    url: https://github.com/lizzzcai/shipwright-samples.git # a private repository
    contextDir: sample-go/source-build
    credentials:
      name: secret-git-basic-auth
  strategy:
    name: buildpacks-v3
    kind: ClusterBuildStrategy
  output:
    image: lizzzcai/sample-go:latest
    credentials:
      name: push-secret
apiVersion: shipwright.io/v1alpha1
kind: BuildRun
metadata:
  generateName: buildpack-go-buildrun-
spec:
  buildRef:
    name: buildpack-go-build
apiVersion: v1
kind: Secret
metadata:
  name: secret-git-basic-auth
  annotations:
    build.shipwright.io/referenced.secret: "true"
type: kubernetes.io/basic-auth
stringData:
  username: lizzzcai
  password: xxx

Below is the error from taskrun:

2021/12/06 07:15:13 Info: ssh (/usr/bin/ssh): OpenSSH_8.0p1, OpenSSL 1.1.1g FIPS  21 Apr 2020
2021/12/06 07:15:13 Info: git (/usr/bin/git): git version 2.27.0
2021/12/06 07:15:13 Info: git-lfs (/usr/bin/git-lfs): git-lfs/2.11.0 (GitHub; linux amd64; go 1.14.4)
2021/12/06 07:15:13 /usr/bin/git clone -h
2021/12/06 07:15:13 /usr/bin/git submodule -h
2021/12/06 07:15:13 /usr/bin/git config --global credential.helper store --file /tmp/cred-helper-file291821018
2021/12/06 07:15:13 error: could not lock config file //.gitconfig: Permission denied (exit code 255)

Step failed

version info

k8s: v1.21.5
shipwright: v0.6.0
tekton: v0.28.1/v0.27.3
@HeavyWombat
Copy link
Contributor

We recently rewrote this part of the Git wrapper step to not rely on a Git config change. PR was #952. Any chance you could try your setup with Shipwright Build at this code level? It is a recent change, so it is not included in a release yet.

@lizzzcai
Copy link
Author

lizzzcai commented Dec 7, 2021

Hi Matthias, thanks for your update. If this issue is fixed in the next release, then probably I will try it out in the next release. Perhaps ShipWirght can consider providing an option to install the latest main branch version (release on every successful merge into main) so that the user can try it out easily.

@SaschaSchwarze0
Copy link
Member

Hi Matthias, thanks for your update. If this issue is fixed in the next release, then probably I will try it out in the next release. Perhaps ShipWirght can consider providing an option to install the latest main branch version (release on every successful merge into main) so that the user can try it out easily.

You can try the nightly release: https://github.com/shipwright-io/build/releases/tag/nightly

@lizzzcai
Copy link
Author

lizzzcai commented Dec 8, 2021

Thanks @SaschaSchwarze0 @HeavyWombat , have tried out the nightly release and it is working.I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants