This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build operator image with chainguard (#250)
- Loading branch information
Showing
8 changed files
with
238 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,41 +6,47 @@ on: | |
- 'v[0-9]+.[0-9]+.[0-9]+\-build\.[0-9]+' | ||
|
||
jobs: | ||
package-and-publish-operator: | ||
|
||
get-tag: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.tag.outputs.tag }} | ||
steps: | ||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
with: | ||
strip_v: true | ||
run: | | ||
TAG=${{ github.ref_name }} | ||
echo "tag=${TAG#v}" >> "$GITHUB_OUTPUT" | ||
package-and-publish-operator: | ||
runs-on: ubuntu-latest | ||
needs: [get-tag] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- name: Login to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: registry.replicated.com | ||
username: ${{secrets.KOTS_HELM_USER_PROD}} | ||
password: ${{secrets.KOTS_HELM_PASS_PROD}} | ||
- name: Docker Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: | | ||
registry.replicated.com/library/embedded-cluster-operator-image:${{steps.tag.outputs.tag}} | ||
- name: Build melange package | ||
run: | | ||
export VERSION=${{needs.get-tag.outputs.tag}} | ||
make melange | ||
- name: Publish apko image | ||
run: | | ||
export VERSION=${{needs.get-tag.outputs.tag}} | ||
export IMAGE=replicated/embedded-cluster-operator-image:${VERSION} | ||
make apko-login \ | ||
REGISTRY=docker.io \ | ||
USERNAME=${{secrets.DOCKERHUB_USER}} \ | ||
PASSWORD=${{secrets.DOCKERHUB_PASSWORD}} | ||
make apko-publish | ||
echo ::notice title=digest::$(cat build/digest) | ||
package-and-publish-helmchart: | ||
runs-on: 'ubuntu-20.04' | ||
needs: package-and-publish-operator | ||
needs: [get-tag, package-and-publish-operator] | ||
steps: | ||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
with: | ||
strip_v: true | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Helm | ||
|
@@ -53,28 +59,24 @@ jobs: | |
HELM_USER: ${{secrets.KOTS_HELM_USER_PROD}} | ||
HELM_PASS: ${{secrets.KOTS_HELM_PASS_PROD}} | ||
HELM_REGISTRY: registry.replicated.com | ||
CHART_VERSION: ${{steps.tag.outputs.tag}} | ||
CHART_VERSION: ${{needs.get-tag.outputs.tag}} | ||
run: | | ||
export OPERATOR_IMAGE_NAME=registry.replicated.com/library/embedded-cluster-operator-image | ||
export OPERATOR_IMAGE_NAME=replicated/embedded-cluster-operator-image | ||
export OPERATOR_IMAGE_TAG=${CHART_VERSION} | ||
export CHART_REMOTE=oci://registry.replicated.com/library | ||
../../scripts/publish-helm-chart.sh | ||
releaser: | ||
runs-on: ubuntu-latest | ||
needs: [get-tag, package-and-publish-helmchart] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- name: Build linux-amd64 | ||
- uses: imjasonh/[email protected] | ||
- name: Download artifact | ||
run: | | ||
make build | ||
mkdir -p bin | ||
crane export --platform linux/amd64 docker.io/replicated/embedded-cluster-operator-image:${{needs.get-tag.outputs.tag}} \ | ||
| tar -Oxf - manager > bin/manager | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
# Go workspace file | ||
go.work | ||
|
||
bin/ | ||
/bin/ | ||
/build/ | ||
|
||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.