Created
June 29, 2020 17:31
-
-
Save faiq/2eb31643ee75619847fb822065f87b85 to your computer and use it in GitHub Desktop.
update gitops
This file contains hidden or 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
#!/bin/sh | |
# This script is used as part of the "update-argo" task from the Dispatchfile | |
COMMIT_SHA=$1 | |
IMAGE_NAME=$2 | |
BRANCH_NAME=$3 | |
set -e | |
echo "$GPG_PRIVATE_KEY" > gpg_private_key | |
echo "$GPG_PUBLIC_KEY" > gpg_public_key | |
set -x | |
apt-get install -y wget | |
wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64 && chmod +x /usr/local/bin/yq | |
gpg --import gpg_private_key | |
gpg --import gpg_public_key | |
git config --local commit.gpgsign true | |
git config --local user.signingkey $GPG_KEY_ID | |
git config --local user.name 'Dispatch CI' | |
git config --local user.email '[email protected]' | |
update-gitops-repo \ | |
-git-revision=$COMMIT_SHA \ | |
-filepath=argo/**.yaml.tmpl \ | |
-substitute=imageName=$IMAGE_NAME \ | |
-substitute=gitsha=$COMMIT_SHA \ | |
-base-branch=$BRANCH_NAME \ | |
-merge-pull-request=true \ | |
-substitute=konvoyVersion=$(yq r cluster.yaml spec.version) \ | |
-substitute=commitSHA=$COMMIT_SHA \ | |
-commit-message="Deploy soak update" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment