add buildspec

This commit is contained in:
Emil Lerch 2020-11-10 08:35:28 -08:00
parent a0e98fb001
commit 0b9bb1a73f
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -0,0 +1,30 @@
version: 0.2
env:
parameter-store:
deploykey: "/github/ungoogled-chromium/deploy_key"
phases:
pre_build:
commands:
- 'echo Got version $VERSION'
- 'echo Got image $IMAGE'
- 'export UPPER_IMAGE=${IMAGE^^}'
- 'export UPPER_IMAGE=${UPPER_IMAGE//-/_}'
- 'echo Uppercased is $UPPER_IMAGE'
- 'echo -----BEGIN OPENSSH PRIVATE KEY----- > ~/.ssh/id_ed25519'
- 'echo "$deploykey" >> ~/.ssh/id_ed25519'
- 'echo -----END OPENSSH PRIVATE KEY----- >> ~/.ssh/id_ed25519'
- 'chmod 600 ~/.ssh/id_ed25519'
#- export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/id_ed25519 -o IdentitiesOnly=yes"
- git config --global user.email versions@lerch.org
- git config --global user.name "Update version bot"
- git checkout master
- git remote add ssh git@github.com:elerch/vcsh_exports.git
- '[ -n "$VERSION" ]'
build:
commands:
- sed -i "s/^export ${UPPER_IMAGE}_VERSION=.\+/export ${UPPER_IMAGE}_VERSION=${VERSION}/g" .exports
- git commit -am "Change version of $IMAGE to $VERSION"
post_build:
commands:
- git push --set-upstream ssh master