-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build kurl-proxy image with Chainguard (#4199)
* Build kurl-proxy image with Chainguard
- Loading branch information
Showing
6 changed files
with
149 additions
and
172 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: 'Build and push kurl-proxy image' | ||
description: 'Composite action for building and pushing kurl-proxy image' | ||
inputs: | ||
image-name: | ||
description: 'Full destination kurl-proxy image name' | ||
required: true | ||
|
||
git-tag: | ||
description: 'Git tag' | ||
required: true | ||
|
||
registry-username: | ||
description: 'Username to login to registry' | ||
default: '' | ||
required: false | ||
|
||
registry-password: | ||
description: 'Password to login to registry' | ||
default: '' | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: template melange and apko configs | ||
shell: bash | ||
run: | | ||
export GIT_TAG=${{ inputs.git-tag }} | ||
envsubst '${GIT_TAG}' < kurl_proxy/deploy/melange.yaml.tmpl > kurl_proxy/deploy/melange.yaml | ||
envsubst '${GIT_TAG}' < kurl_proxy/deploy/apko.yaml.tmpl > kurl_proxy/deploy/apko.yaml | ||
- id: cache-dir | ||
shell: bash | ||
run: echo "cache_dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" | ||
|
||
- uses: chainguard-dev/actions/melange-build@main | ||
with: | ||
config: kurl_proxy/deploy/melange.yaml | ||
archs: x86_64 | ||
sign-with-temporary-key: true | ||
cache-dir: ${{ steps.cache-dir.outputs.cache_dir }} | ||
|
||
- uses: chainguard-images/actions/apko-publish@main | ||
with: | ||
config: kurl_proxy/deploy/apko.yaml | ||
archs: x86_64 | ||
tag: ${{ inputs.image-name }} | ||
vcs-url: true | ||
generic-user: ${{ inputs.registry-username }} | ||
generic-pass: ${{ inputs.registry-password }} |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
contents: | ||
repositories: | ||
- https://packages.wolfi.dev/os | ||
- ./packages/ | ||
keyring: | ||
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub | ||
- ./melange.rsa.pub | ||
packages: | ||
- kurl-proxy-head # This is expected to be built locally by `melange`. | ||
- bash | ||
- busybox | ||
- curl | ||
- git | ||
- wolfi-baselayout | ||
|
||
accounts: | ||
groups: | ||
- groupname: kotsadm | ||
gid: 1001 | ||
users: | ||
- username: kotsadm | ||
uid: 1001 | ||
gid: 1001 | ||
run-as: kotsadm | ||
|
||
environment: | ||
VERSION: ${GIT_TAG} | ||
|
||
cmd: /kurl_proxy | ||
|
||
archs: | ||
- x86_64 | ||
- aarch64 |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package: | ||
name: kurl-proxy-head | ||
version: ${GIT_TAG} | ||
epoch: 0 | ||
description: kurl-proxy package | ||
copyright: | ||
- license: Apache-2.0 | ||
|
||
environment: | ||
contents: | ||
repositories: | ||
- https://packages.wolfi.dev/os | ||
keyring: | ||
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub | ||
packages: | ||
- ca-certificates-bundle | ||
- busybox | ||
- git | ||
- go | ||
environment: | ||
GOMODCACHE: '/var/cache/melange' | ||
|
||
pipeline: | ||
- runs: | | ||
set -x | ||
export DESTDIR="${{targets.destdir}}" | ||
mkdir -p "${DESTDIR}" | ||
|
||
make -C kurl_proxy build | ||
|
||
mv kurl_proxy/bin/kurl_proxy "${DESTDIR}/kurl_proxy" | ||
mv kurl_proxy/assets "${DESTDIR}/assets" |