-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Lukas Hinterreiter <[email protected]>
- Loading branch information
Showing
4 changed files
with
93 additions
and
8 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
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,61 @@ | ||
name: Upload helm package | ||
description: Upload the helm package | ||
inputs: | ||
registry-username: | ||
description: Username for the OCI registry | ||
required: true | ||
registry-password: | ||
description: Password for the OCI registry | ||
required: true | ||
registry-url: | ||
description: URL for the OCI registry | ||
required: true | ||
default: registry.hub.docker.com | ||
registry-namespace: | ||
description: Repository in the OCI registry | ||
required: true | ||
default: dynatrace | ||
image-base-url: | ||
description: Base URL for the image | ||
required: true | ||
default: docker.io | ||
helm-repository-name: | ||
description: Repository used in the OCI registry, be aware that helm upload does infer this from the helm package name itself | ||
required: true | ||
default: dynatrace-operator | ||
version: | ||
description: The version of the helm package to upload | ||
required: true | ||
version-without-prefix: | ||
description: The version of the helm package to upload without the leading 'v' character | ||
required: true | ||
cosign-private-key: | ||
description: Private key used to sign the helm package | ||
required: true | ||
cosign-password: | ||
description: Password used to encrypt the private key | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Upload helm package to OCI registry | ||
id: push-helm-to-OCI | ||
shell: bash | ||
run: | | ||
helm registry login -u "${{ inputs.registry-username }}" -p "${{ inputs.registry-password }}" "${{ inputs.registry-url }}" | ||
hack/build/ci/push-helm-chart.sh \ | ||
"./helm-pkg/dynatrace-operator-${{ inputs.version-without-prefix }}.tgz" \ | ||
"oci://${{ inputs.registry-url }}/${{ inputs.registry-namespace }}" | ||
- name: Login to Registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ inputs.image-base-url }} | ||
username: ${{ inputs.registry-username }} | ||
password: ${{ inputs.registry-password }} | ||
- name: Sign OCI package with cosign | ||
uses: ./.github/actions/sign-image | ||
with: | ||
image: "${{ inputs.image-base-url }}/${{ inputs.registry-namespace }}/${{ inputs.helm-repository-name }}:${{ inputs.version }}@${{ steps.push-helm-to-OCI.outputs.digest }}" | ||
signing-key: ${{ inputs.cosign-private-key }} | ||
signing-password: ${{ inputs.cosign-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
readonly PATH_TO_HELM_CHART="${1}" | ||
readonly REGISTRY_URL="${2}" | ||
|
||
output=$(helm push "${PATH_TO_HELM_CHART}" "${REGISTRY_URL}" 2>&1) | ||
exit_status=$? | ||
|
||
if [ $exit_status -eq 0 ]; then | ||
digest=$(echo "$output" | awk '/Digest:/ {print $2}') | ||
echo "digest=$digest" >> $GITHUB_OUTPUT | ||
else | ||
echo "Command failed with exit status $exit_status. Error: $output" | ||
exit $exit_status | ||
fi |