Update .gitlab-ci.yml file
This commit is contained in:
parent
cef3e51ccd
commit
b257103901
1 changed files with 21 additions and 1 deletions
|
@ -3,6 +3,8 @@ stages: # List of stages for jobs, and their order of execution
|
||||||
- test
|
- test
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
|
image: debian
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
# Use the official docker image.
|
# Use the official docker image.
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
|
@ -29,5 +31,23 @@ docker-build:
|
||||||
- if: $CI_COMMIT_BRANCH
|
- if: $CI_COMMIT_BRANCH
|
||||||
exists:
|
exists:
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev"
|
- if: ($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev")
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq
|
||||||
|
- apt-get install -qq git
|
||||||
|
# Setup SSH deploy keys
|
||||||
|
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
||||||
|
|
||||||
|
deploy_staging:
|
||||||
|
type: deploy
|
||||||
|
script:
|
||||||
|
- ssh $SSH_SERVER "cd /root && docker-compose up -d shbot && exit"
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
Loading…
Reference in a new issue