-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build local-volume-provider image with chainguard (#37)
* Build local-volume-provider image with chainguard
- Loading branch information
Showing
7 changed files
with
121 additions
and
21 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 local-volume-provider image' | ||
description: 'Composite action for building and pushing local-volume-provider image' | ||
inputs: | ||
image-name: | ||
description: 'Full destination local-volume-provider 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}' < deploy/melange.yaml.tmpl > deploy/melange.yaml | ||
envsubst '${GIT_TAG}' < deploy/apko.yaml.tmpl > 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: 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: 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
File renamed without changes.
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,19 @@ | ||
contents: | ||
repositories: | ||
- https://packages.wolfi.dev/os | ||
- ./packages/ | ||
keyring: | ||
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub | ||
- ./melange.rsa.pub | ||
packages: | ||
- local-volume-provider-head # This is expected to be built locally by `melange`. | ||
- bash | ||
- busybox | ||
- curl | ||
- git | ||
- wolfi-baselayout | ||
|
||
environment: | ||
VERSION: ${GIT_TAG} | ||
|
||
cmd: /bin/bash -c "cp /plugins/* /target/." |
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,37 @@ | ||
package: | ||
name: local-volume-provider-head | ||
version: ${GIT_TAG} | ||
epoch: 0 | ||
description: local-volume-provider 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}/plugins" | ||
|
||
export VERSION=${{package.version}} | ||
|
||
CGO_ENABLED=0 go build \ | ||
-ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " \ | ||
-o "${DESTDIR}/plugins/local-volume-provider" ./cmd/local-volume-provider | ||
|
||
CGO_ENABLED=0 go build \ | ||
-ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " \ | ||
-o "${DESTDIR}/local-volume-fileserver" ./cmd/local-volume-fileserver |