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

ci(ci): Push built CI images to Quay #545

Merged
merged 5 commits into from
Jul 7, 2021
Merged

Conversation

ebaron
Copy link
Member

@ebaron ebaron commented Jul 2, 2021

This PR adds steps to our CI workflow that push the build image to Quay. This uses the redhat-actions/push-to-registry action. The step only runs on push, excluding forks. The image tags pushed to Quay are the image version defined in the POM (currently 2.0.0-SNAPSHOT), latest, and the commit SHA. The latter creates a new tag upon each commit. I'm not sure if we want this. It's nice for traceability, but will end up creating a lot of tags.

The push is done by a robot account in Quay, whose credentials will be stored in a Github secret [1]. To test, I temporarily substituted the Cryostat account for my own. The results can be seen below:

CI on PR, not pushed to Quay: https://github.com/ebaron/cryostat/runs/2975581732
CI on push, pushed to Quay: https://github.com/ebaron/cryostat/runs/2975629893

[1] https://docs.github.com/en/actions/reference/encrypted-secrets

@ebaron ebaron requested a review from andrewazores July 2, 2021 20:56
@andrewazores
Copy link
Member

Cool, looks good, although I do also think pushing/tagging an image for every upstream commit might be a bit much. Is there a way to do it for latest, the pom version, and any git tag that might also be associated with the commit? That way versions that have no git tag just bump latest and the pom version, but we can still put up things like betas and RCs using git tags.

Oh, I do have a question regarding the latest tag. If we apply this to both main and v1, we can remove the config for latest from v1 so that the latest tag is sort of "monotonically increasing", right?

@ebaron
Copy link
Member Author

ebaron commented Jul 5, 2021

Cool, looks good, although I do also think pushing/tagging an image for every upstream commit might be a bit much. Is there a way to do it for latest, the pom version, and any git tag that might also be associated with the commit? That way versions that have no git tag just bump latest and the pom version, but we can still put up things like betas and RCs using git tags.

We could use the release event for Github releases, but it might be possible to to using tags [1]. Is this something we need though? For beta releases wouldn't we update the POM version as well?

Oh, I do have a question regarding the latest tag. If we apply this to both main and v1, we can remove the config for latest from v1 so that the latest tag is sort of "monotonically increasing", right?

I'm still not clear exactly how the workflows work in non-default branches, but we definitely want latest to only point to builds from main.

[1] https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release

@andrewazores
Copy link
Member

We could use the release event for Github releases, but it might be possible to to using tags [1]. Is this something we need though? For beta releases wouldn't we update the POM version as well?

I suppose we would, but this would mean we either have to update the pom version along with every PR after the first beta, or if we don't, then existing beta tags on quay.io would be overwritten by later builds with the same version.

I guess betas would come off an upstream version branch anyway, so updating the pom along with every backport PR would be okay.

@andrewazores andrewazores added the ci label Jul 6, 2021
@andrewazores andrewazores changed the title Push CI images to Quay ci(ci): Push built CI images to Quay Jul 6, 2021
@andrewazores andrewazores merged commit 297838a into cryostatio:main Jul 7, 2021
@ebaron ebaron added the backport label Jul 8, 2021
ebaron added a commit to ebaron/cryostat that referenced this pull request Jul 8, 2021
* Push CI builds to quay.io

* Extract image name to environment variable

* Update step name

* Name steps

* Fix image property
ebaron added a commit to ebaron/cryostat that referenced this pull request Jul 8, 2021
* Push CI builds to quay.io

* Extract image name to environment variable

* Update step name

* Name steps

* Fix image property
ebaron added a commit that referenced this pull request Jul 9, 2021
* ci(ci): Push built CI images to Quay (#545)

* Push CI builds to quay.io

* Extract image name to environment variable

* Update step name

* Name steps

* Fix image property

* ci(quay): remove Git SHA from image tags (#558)

* Remove main branch, remove latest tag

* Remove tag step
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.

2 participants