Skip to content

Conversation

@vadorovsky
Copy link
Member

@vadorovsky vadorovsky commented Nov 22, 2021

We had problems with building based on the official Rust image, based on
Debian. It's more convenient if we just stick to openSUSE and manage all
dependencies ourselves.

This PR also adds container builds for pull requests. For two reasons:

  1. In case of failures on the main branch, to check whether a pull request aiming to fix them really fixes them.
  2. Might be nice for testing someones' changes before merging, without necessity to check out and build their code.

@vadorovsky vadorovsky marked this pull request as draft November 22, 2021 18:31
@vadorovsky vadorovsky force-pushed the fix-builder-image branch 3 times, most recently from 447c47e to a22d733 Compare November 22, 2021 19:27
@vadorovsky vadorovsky marked this pull request as ready for review November 22, 2021 19:56
@vadorovsky vadorovsky force-pushed the fix-builder-image branch 2 times, most recently from 30897db to 0cc5e4b Compare November 22, 2021 21:39
ghcr.io/rancher-sandbox/lockc:latest
-
name: Retrieve pull request number
if: ${{ startsWith(github.ref, 'refs/pull/') }}
Copy link
Member Author

@vadorovsky vadorovsky Nov 22, 2021

Choose a reason for hiding this comment

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

@nickgerace I have an explanation for those if statements now.

So, this whole file is triggered by many events which are mutual exclusive when it comes to pushing images. We trigger this workflow on:

  • push to main branch (merging a PR) (github.ref is refs/heads/*)
  • creating a tag (github.ref is refs/tags/*)
  • submitting a pull request (github.ref is refs/pull/*)

For all of those actions we want to build an image, but we want to push it differently. To handle then differently, we need to catch them with if statements.

That's why we do:

  • if: ${{ startsWith(github.ref, 'refs/pull/') }}
  • if: ${{ startsWith(github.ref, 'refs/heads/') }}
  • if: ${{ startsWith(github.ref, 'refs/tags/') }}

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for the explanation!

We had problems with building based on the official Rust image, based on
Debian. It's more convenient if we just stick to openSUSE and manage all
dependencies ourselves.

Signed-off-by: Michal Rostecki <[email protected]>
@vadorovsky vadorovsky force-pushed the fix-builder-image branch 2 times, most recently from 29fcfa6 to 21593a1 Compare November 22, 2021 23:24
This change adds container builds for pull requests. For two reasons:

1) In case of failures on the main branch, to check whether a pull
   request aiming to fix them really fixes them.
2) Might be nice for testing someones' changes before merging, without
   necessity to check out and build their code.

Signed-off-by: Michal Rostecki <[email protected]>
Copy link
Collaborator

@mjura mjura left a comment

Choose a reason for hiding this comment

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

LGTM

@vadorovsky vadorovsky merged commit 4f51474 into lockc-project:main Nov 24, 2021
@vadorovsky vadorovsky deleted the fix-builder-image branch November 24, 2021 07:07
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

Successfully merging this pull request may close these issues.

3 participants