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

Convert gocardless/stolon-pgbouncer to Github Actions #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sam-robson
Copy link

Pipeline migrated from Circle CI 🎉

Manual steps

Perform the follow steps to complete the migration:

gocardless/stolon-pgbouncer/build-integration

  • Ensure environment variable is updated: DOCKER_PASS
  • Ensure environment variable is updated: DOCKER_USER
  • Ensure environment variable is updated: GITHUB_TOKEN

env:
DOCKER_PASS: xxxx9e14
DOCKER_USER: xxxxdmin
GITHUB_TOKEN: xxxx6d08
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this was set to before. We might be able to get away with the usual GITHUB_TOKEN injected by GHA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Sam 👋

A note of warning: this is a public repo that anyone can open PRs to, so you’ll want to double check you don’t respond to those changes by running builds on any private GitHub agents you may have had around.

Especially if you’re relying on ambient creds on those machines, which might mean people outside of GC could exfiltrate GitHub resources under the GC org by misusing the creds.

I’ve not checked this super closely, but wanted to warn you in case you hadn’t considered it. It may make more sense to leave this and other open source repos on Circle, to avoid exposing the private infra.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Lawrence,

Thanks for the heads up!
We don't have self-hosted runners set up just yet, but when we do we'll restrict them to run solely on private repositories, and leave public repos to use Github's runners.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, wanted to nudge you in case it had gone under the radar, but sounds like you’re on it :)

Comment on lines +36 to +40
- uses: actions/upload-artifact@v2
with:
path: |-
/go/src/github.com/gocardless/stolon-pgbouncer/bin/stolon-pgbouncer.linux_amd64
/go/src/github.com/gocardless/stolon-pgbouncer/bin/stolon-pgbouncer-acceptance.linux_amd64
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think uploading and downloading the artifact here and below is unnecessary. We could probably just bundle the build & acceptance into one job?

working-directory: "/go/src/github.com/gocardless/stolon-pgbouncer"
runs-on: ubuntu-latest
container:
image: gocardless/stolon-pgbouncer-circleci:2020050701
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image: gocardless/stolon-pgbouncer-circleci:2020050701
image: gocardless/stolon-pgbouncer-ci:2020050701

We should remove references to circle throughout the repo.

- unit-integration
steps:
# # 'setup_remote_docker' was not transformed because there is no suitable equivalent in GitHub Actions
- run: docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like our image installs docker so we can get away without adding much here. What registry are we wanting to login to? If it is GCR then we might want to make use of workload identity federation so we can bin some long lived credentials https://github.com/docker/login-action#google-container-registry-gcr

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using docker hub, as this is a public project.

https://hub.docker.com/r/gocardless/stolon-pgbouncer/tags

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

Successfully merging this pull request may close these issues.

3 participants