Commit e6b87880 authored by Fabien Amarger's avatar Fabien Amarger
Browse files

[gitlab-ci] Deploy on spirhal.cri-association.fr

To do so, the sftp protocol must be used.
parent 718b1dd5
......@@ -10,7 +10,7 @@ cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- node_modules/
- node_modules/
build:
before_script:
......@@ -23,32 +23,32 @@ deploy-prod:
only:
- tags
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y)'
- apt-get update -y
- apt-get install -y lftp
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -H 'amarger.murloc.fr' >> ~/.ssh/known_hosts
- ssh-keyscan -H "${SERVER}" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- export GIT_TAG=$(git describe --tags --abbrev=0 HEAD)
stage: deploy
script:
- scp ./releases/Spirhal-$GIT_TAG.js spirhal@amarger.murloc.fr:~/releases/
- scp ./releases/Spirhal-$GIT_TAG.js spirhal@amarger.murloc.fr:~/releases/Spirhal-latest.js
- lftp -u $USER,$PASSWORD -p $PORT sftp://$SERVER -e "put -O /www/releases/ ./releases/Spirhal-$GIT_TAG.js; put -O /www/releases/ ./releases/Spirhal-${GIT_TAG}.js -o Spirhal-latest.js; exit;"
deploy-beta:
except:
- tags
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y && apt-get install lftp -y )'
- apt-get update -y
- apt-get install -y lftp
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -H 'amarger.murloc.fr' >> ~/.ssh/known_hosts
- ssh-keyscan -H "${SERVER}" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- export GIT_TAG=$(git describe --tags --abbrev=0 HEAD)
stage: deploy
script:
- scp ./releases/Spirhal-$GIT_TAG.js spirhal@amarger.murloc.fr:~/releases/Spirhal-beta.js
- scp ./dist/*.js.map spirhal@amarger.murloc.fr:~/releases/
- lftp -u $USER,$PASSWORD -p $PORT sftp://$SERVER -e "put -O /www/releases/ ./releases/Spirhal-${GIT_TAG}.js -o Spirhal-beta.js; mput -O /www/releases/ ./dist/*.js.map; exit;"
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