Commit fbad1f4a authored by Jacob Priddy's avatar Jacob Priddy 👌

revamp deploy process for new deploy method

parent c4da1249
......@@ -5,6 +5,12 @@ stages:
- test
- deploy
before_script:
- >
if [ -z ${CI_COMMIT_TAG+x} ]; then
printf "${CI_COMMIT_TAG}" > version.txt
fi
build_tests:
stage: build
script:
......@@ -37,23 +43,17 @@ test_application:
deploy_controller_update:
stage: deploy
tags:
- elock
before_script:
- apt-get update -qq
- apt-get install -qq rsync
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d -w 0)
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo "CI_COMMIT_TAG"
script:
- echo "$SIGNING_KEY" | base64 -d -w 0 > decoded.pem
- espsecure.py sign_data --keyfile decoded.pem --version 1 build/door-controller.bin
- version=$(<version.txt)
- deploy_name="v${version}.bin"
- echo "Deploying ${deploy_name}"
# Can't use the CI job token to deploy the artifact because that's a "pRemiUm FEATurE"
- "rsync build/door-controller.bin $SSH_USER@$SSH_HOST:/home/$SSH_USER/doorcode/src/backend/storage/app/controller/binaries/$deploy_name"
when: manual
- mv "build/door-controller.bin" "${PROJ_DIR}/controller-bins/${deploy_name}"
only:
- master
- tags
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment