-
Notifications
You must be signed in to change notification settings - Fork 39
/
.gitlab-ci.yml
80 lines (72 loc) · 1.98 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cache:
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME"
paths:
- $HOME/.m2/
before_script:
- mkdir -p $HOME/.m2/
stages:
# - test
- package
- deploy
# maven-test:
# image: maven:3.3-jdk-8
# stage: test
# only:
# - develop
# - master
# script:
# - mvn clean test $ENV_TEST -Dtest=Runner
docker-build-staging:
image: docker:latest
stage: package
only:
- develop
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/$CI_PROJECT_NAMESPACE/chatbot:staging .
- docker push registry.gitlab.com/$CI_PROJECT_NAMESPACE/chatbot:staging
docker-build:
image: docker:latest
stage: package
only:
- master
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/$CI_PROJECT_NAMESPACE/chatbot:latest .
- docker push registry.gitlab.com/$CI_PROJECT_NAMESPACE/chatbot:latest
deploy:
stage: deploy
only:
- master
environment:
name: production
script:
- curl titan.aksw.uni-leipzig.de:9000/hooks/redeploy-chatbot?token=$DEPLOY_TOKEN -L
# deploy-staging:
# image: rastasheep/ubuntu-sshd
# stage: deploy
# only:
# - develop
# environment:
# name: staging
# url: http://akswnc9.aksw.uni-leipzig.de:1983
# script:
# - mkdir -p ~/.ssh
# - echo "$AKSW_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
# - ssh -o StrictHostKeyChecking=no -tt $AKSW_USERNAME@$AKSW_HOST "echo $AKSW_PASSWORD | sudo -S ./deploy_chatbot $CI_BUILD_TOKEN $CI_PROJECT_NAMESPACE staging"
# deploy:
# image: rastasheep/ubuntu-sshd
# stage: deploy
# only:
# - master
# environment:
# name: production
# url: http://akswnc9.aksw.uni-leipzig.de:1984
# script:
# - mkdir -p ~/.ssh
# - echo "$AKSW_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
# - ssh -o StrictHostKeyChecking=no -tt $AKSW_USERNAME@$AKSW_HOST "echo