Commit 06cc40ea authored by Benoit Rapidel's avatar Benoit Rapidel 🎤

Add deploy job

parent 1ff5cde8
Pipeline #1310 passed with stage
in 32 seconds
......@@ -85,3 +85,38 @@ package:v6:
extends: .package
dependencies:
- build:v7
deploy:
stage: deploy
image: alpine
only:
- /^v\d+\.\d+$/
- /^v\d+\.\d+\.\d+$/
except:
- branches
tags:
- linux
environment:
name: production
url: "https://downloads.exmachina.fr/${CI_PUBLIC_NAME}/${CI_PUBLIC_NAME} - latest.zip"
dependencies:
- package:v6
before_script:
- 'which ssh-agent || ( apk add --update openssh-client git )'
- eval $(ssh-agent -s)
##
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$DEPLOY_HOSTKEY" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- export BUILD_FILENAME="${CI_PUBLIC_NAME} - ${CI_COMMIT_REF_NAME}"
- ssh $DEPLOY_USER@downloads.exmachina.fr bin/update-latest.sh $CI_PUBLIC_NAME "'${BUILD_FILENAME}.zip'"
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