GoogleCloudPlatform / cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
https://cloud.run
Apache License 2.0
527 stars 92 forks source link

Setup CI #110

Open jamesward opened 4 years ago

jamesward commented 4 years ago

I'd be nice to run CI as part of the Cloud Build process.

I'm running go test and getting:

    clone_test.go:94: clone(git@github.com:google/new-project.git) error = git clone failed: exit status 128, output:
        Cloning into '/tmp/git-clone-test475820070/test-3'...
        git@github.com: Permission denied (publickey).
        fatal: Could not read from remote repository.

        Please make sure you have the correct access rights
        and the repository exists.
        , wantErr false

This is because I don't have an SSH key setup. It might be acceptable to instead use git://github.com/google/new-project.git but then we wouldn't be testing SSH cloning. To automate testing of SSH cloning we'd need to have a test account with an SSH key and have that key setup on the CI machine.

ahmetb commented 4 years ago

AFAIK setting up Cloud Build sounds really hard, if possible at all.

  1. Cloud Build does not expose an API to authenticate to GitHub. Their experience is purely UI based.

  2. There are no secrets in OiCS shell. To clone a private repo from GitHub on OiCS shell, you'd need to create a ssh key/copy it --> add it to github --> then clone.

Is the "git clone" issue you reported above related to GCB? If not let's open a new issue. We don't use git:// to clone as it would always prompt for auth even for public repos.

jamesward commented 4 years ago

Yeah, you are right that cloning over SSH isn't something we want to support. So we should fix that test and then don't actually need to do any secrets for CI on Cloud Build.