Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Build containers in CI/CD #250

Merged
merged 2 commits into from
Sep 20, 2021

Conversation

fabriziosestito
Copy link
Member

Uses github actions to build containers on every merge on main.

If a release event is detected a container with the release tag is built and pushed, otherwise the container the rolling tag container gets updated.

It also supports cache + manual dispatch.

dottorblaster
dottorblaster previously approved these changes Sep 16, 2021
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

YES

- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Copy link
Member Author

Choose a reason for hiding this comment

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

This needed to add the capability to use an external cache

Copy link
Contributor

Choose a reason for hiding this comment

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

Dude are you really commenting your own PR? 😂

Copy link
Member Author

Choose a reason for hiding this comment

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

aha yes i thought it would help reviewing since it is a magic yaml

tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Copy link
Member Author

Choose a reason for hiding this comment

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

Uses GitHub Action cache

@stefanotorresi
Copy link
Member

Since #248 is causing a conflict on the workflow file name here, I also realized that this workflow doesn't actually depend on the build job of the CI workflow, so we might as well have it in a completely separate file, like the one for the OBS delivery.
What do you think?

@fabriziosestito
Copy link
Member Author

fabriziosestito commented Sep 16, 2021

Since #248 is causing a conflict on the workflow file name here, I also realized that this workflow doesn't actually depend on the build job of the CI workflow, so we might as well have it in a completely separate file, like the one for the OBS delivery.
What do you think?

@stefanotorresi we choose to depend on the build job since it performs the testing as well. it would be nice to have separate jobs for testing etc but I think it still means the job should be in the same workflow to be dependent to the test stage?

We could also create a composite action for test/vet check and execute it again in the docker workflow

@stefanotorresi
Copy link
Member

stefanotorresi commented Sep 17, 2021

Hmm, you make a good point, but the discussion then gets tricky: by the same logic, we shouldn't build broken code in OBS either.
Shall we consolidate all the builds in the same workflow where all the downstream jobs are blocked by the one where we execute the tests, then?

@fabriziosestito
Copy link
Member Author

fabriziosestito commented Sep 17, 2021

@stefanotorresi I think this is an option. if we want to keep separate workflows we will need to move the test steps in composite action, and repeat the step in every workflow that is needed, this way we repeat the step,yes, but the workflow will work in a parallel fashion.

EDIT: I'm leaning more toward the first option you proposed tho, it's easier to add a test step and let the other jobs depend on it, also they will work in parallel also this way.

@stefanotorresi
Copy link
Member

stefanotorresi commented Sep 17, 2021

EDIT: I'm leaning more toward the first option you proposed tho, it's easier to add a test step and let the other jobs depend on it, also they will work in parallel also this way.

All right then; unless the rest of the team has objections, go for it!
One workflow to rule them all.

Copy link
Member

@stefanotorresi stefanotorresi left a comment

Choose a reason for hiding this comment

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

Let's consolidate all the CI jobs into a single workflow, with all the CD jobs depending on the test one.

@rtorrero
Copy link
Contributor

Let's consolidate all the CI jobs into a single workflow, with all the CD jobs depending on the test one.

I'm on it already

fabriziosestito and others added 2 commits September 17, 2021 14:00
Co-authored-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Copy link
Member

@stefanotorresi stefanotorresi left a comment

Choose a reason for hiding this comment

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

Good. As discussed in Slack, I'll leave a follow-up to fork https://github.com/arbulu89/continuous-delivery in the trento-project org.

@stefanotorresi stefanotorresi merged commit ce1387e into trento-project:main Sep 20, 2021
@stefanotorresi stefanotorresi added the enhancement Improvement of existing features label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Improvement of existing features
Development

Successfully merging this pull request may close these issues.

None yet

4 participants