Skip to content

Commit

Permalink
Add manifest pipeline for rke2-runtime docker image
Browse files Browse the repository at this point in the history
Signed-off-by: galal-hussein <[email protected]>
  • Loading branch information
galal-hussein committed Jul 23, 2024
1 parent 616d184 commit 57e0afc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 14 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,31 @@ jobs:
dapper -f Dockerfile --target dapper make publish-binary
env:
GH_TOKEN: ${{ github.token }}
manifest:
needs: [release-amd64, release-arm64]
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
- name: Manifest
run: |
GITHUB_ACTION_TAG=${{ github.ref_name }} dapper -f Dockerfile --target dapper make publish-manifest-runtime
env:
DOCKER_USERNAME: ${{ env.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ env.DOCKER_PASSWORD }}
dispatch:
needs: [release-amd64, release-arm64]
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ dev-peer-enter: ## Enter the peer shell on another termi
publish-manifest-kubernetes: build-image-kubernetes ## Create and push the kubernetes manifest
./scripts/publish-manifest-kubernetes

.PHONY: publish-manifest-runtime
publish-manifest-runtime: ## Create and push the runtime manifest
./scripts/publish-manifest-runtime

.PHONY: publish-binary
publish-binary: ## Upload binaries
./scripts/publish-binary
Expand Down
14 changes: 0 additions & 14 deletions manifest-runtime.tmpl

This file was deleted.

23 changes: 23 additions & 0 deletions scripts/publish-manifest-runtime
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -ex

cd $(dirname $0)/..

source ./scripts/version.sh
export DOCKER_CLI_EXPERIMENTAL=enabled

docker manifest create \
${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION} \
${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-linux-amd64 \
${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-linux-arm64 \
${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64

docker manifest annotate ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION} ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-linux-amd64 --os linux --arch amd64
docker manifest annotate ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION} ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-linux-arm64 --os linux --arch arm64
docker manifest annotate ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION} ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 --os windows --arch amd64

set +x
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
set -x

docker manifest push ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}

0 comments on commit 57e0afc

Please sign in to comment.