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

Add workflow to automate backstage builds #17

Merged
merged 12 commits into from
May 28, 2024
Merged

Conversation

omrishiv
Copy link
Contributor

@omrishiv omrishiv commented May 13, 2024

What this does

This takes the work from https://github.com/cnoe-io/backstage-image-builder and merges it into this repository with an added Workflow file to automate building, tagging, and pushing the backstage image to ghcr. It uses the format ghcr.io/cnoe-io/backstage-app:GITSHA as the image name. This image will be built on every commit into the backstage-app repo, whether on a push to main or a PR. It also writes the image attestation to the repository for added supply chain security.

Example

https://github.com/omrishiv/backstage-app/actions/runs/9067164285

omrishiv added 12 commits May 13, 2024 10:38
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
@jessesanford
Copy link
Contributor

This is great. Thank you. @nabuskey I think you should probably take a look at this though.

@jessesanford jessesanford requested a review from nabuskey May 13, 2024 21:43
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for? We are invoking the cnoe cli for no reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jessesanford this is from your work; can you clarify? I just lifted it from the other repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't thoroughly looked through the cli code, but does it use the same method as kubernetes to get a client? If that method is leveraged, it can use either the kubeconfig in the home directory or an in-cluster driven client using kubernetes service account and I believe we won't need this file.

Copy link
Contributor

@jessesanford jessesanford May 28, 2024

Choose a reason for hiding this comment

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

This allows for us to just-in-time add the auth for the local Kubernetes cluster when the cnoe cli is invoked by the cnoe plugin to do perform the "verify" step. Without it, the cnoe cli invocation dies because it can't auth to the local kube.

Copy link
Contributor

@jessesanford jessesanford left a comment

Choose a reason for hiding this comment

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

+1 from me

Copy link
Contributor

@jessesanford jessesanford May 28, 2024

Choose a reason for hiding this comment

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

This allows for us to just-in-time add the auth for the local Kubernetes cluster when the cnoe cli is invoked by the cnoe plugin to do perform the "verify" step. Without it, the cnoe cli invocation dies because it can't auth to the local kube.

@nabuskey nabuskey merged commit 9ee3514 into cnoe-io:main May 28, 2024
1 check passed
@omrishiv
Copy link
Contributor Author

@nabuskey Do you mind: https://stackoverflow.com/a/72585915

@OneCricketeer
Copy link

Is there an example of building this image with Argo Workflows and pushing into Gitea OCI registry? This would aid with faster development, I think. Ref #20

@nabuskey
Copy link
Contributor

@OneCricketeer we don't have that yet. BUT we are building an example for building and pushing to the internal gitea registry as part of a workshop we are creating. It's still in WIP but is coming soon :)

If you can't wait you can probably base it off of this: https://github.com/cnoe-io/backstage-app/blob/main/.github/workflows/build-and-push.yaml

@OneCricketeer
Copy link

@nabuskey I believe I am part of that workshop 😉

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.

4 participants