Commit 58fc6dea authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add deployment to gitlab-ci

parent 26beab65
Pipeline #42435 passed with stages
in 2 minutes and 13 seconds
image: golang:1.12-alpine image: golang:1.12-alpine
cache:
paths:
- /go/src/github.com
- /go/src/golang.org
- /go/src/google.golang.org
- /go/src/gopkg.in
- /go/src/git.scc.kit.edu
stages: stages:
- lint - lint
- build - build
- deploy
before_script: before_script:
- apk add --no-cache git make - apk add --no-cache git make rsync openssh-client
- mkdir -p /go/src/git.scc.kit.edu/feudal /go/src/_/builds - mkdir -p /go/src/git.scc.kit.edu/feudal /go/src/_/builds
- cp -r $CI_PROJECT_DIR /go/src/git.scc.kit.edu/feudal/feudalClient - cp -r $CI_PROJECT_DIR /go/src/git.scc.kit.edu/feudal/feudalClient
- ln -s /go/src/git.scc.kit.edu/feudal /go/src/_/builds/feudalClient - ln -s /go/src/git.scc.kit.edu/feudal /go/src/_/builds/feudalClient
...@@ -31,3 +24,32 @@ build: ...@@ -31,3 +24,32 @@ build:
artifacts: artifacts:
paths: paths:
- feudalClient - feudalClient
deploy_dev:
stage: deploy
environment:
name: dev
only:
- dev
- master
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- rsync -v feudalClient $DEV_USER@$DEV_HOST:bin/feudalClientDev
deploy_master:
stage: deploy
environment:
name: master
only:
- master
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- rsync -v feudalClient $DEV_USER@$DEV_HOST:bin/feudalClient
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