Skip to content

Commit

Permalink
Update gitlab ci yml (add deploy task for flisol server)
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeG committed Mar 4, 2019
1 parent 297e231 commit fd96d84
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,11 @@ sass-lint:

deploy:
stage: deploy
image: node:latest
when: manual
only:
- autodeploy
image: docker:git
script:
# Install ssh-agent if not already installed, it is required by Docker.
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'

# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)

# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)

# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- ssh $SSH_USER@$SSH_HOST -p $SSH_PORT $SSH_SCRIPT

- apk update && apk add sshpass
- export SSHPASS=$SSH_PASS
- sshpass -e ssh -p $SSH_PORT -o stricthostkeychecking=no -x $SSH_USER@$SSH_HOST $SSH_SCRIPT

0 comments on commit fd96d84

Please sign in to comment.