geekbot/.gitlab-ci.yml

39 lines
1 KiB
YAML
Raw Normal View History

2018-01-15 18:40:54 +01:00
stages:
- build
- deploy
2018-01-01 17:42:18 +01:00
before_script:
- set -e
- set -u
- set -o pipefail
build:
2018-01-15 18:40:54 +01:00
stage: build
image: microsoft/dotnet:2.0.3-sdk-stretch
artifacts:
expire_in: 1h
paths:
- Geekbot.net/Binaries/
2018-01-01 17:42:18 +01:00
script:
- dotnet restore
2018-01-15 18:40:54 +01:00
- dotnet publish --configuration Release -o Binaries ./
deploy:
stage: deploy
image: instrumentisto/rsync-ssh
only:
- master
dependencies:
- build
2018-01-18 23:47:42 +01:00
environment:
name: Production
url: https://discordapp.com/oauth2/authorize?client_id=171249478546882561&scope=bot&permissions=1416834054
2018-01-15 18:40:54 +01:00
before_script:
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n StrictHostKeyChecking no" > ~/.ssh/config'
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- chmod 700 ~/.ssh
script:
- rsync -rav -e "ssh -p 65432" ./Geekbot.net/Binaries/* www-data@31.220.42.224:$DEPPATH
- ssh -p 65432 www-data@31.220.42.224 "sudo systemctl restart geekbot.service"