forked from dice-group/AGDISTIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
76 lines (70 loc) · 1.56 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
stages:
- test
- build
- build-docker
- test-docker
- release
variables:
TEST_IMAGE: aksw/agdistis:$CI_BUILD_REF_NAME
TEST_IMAGE_DICE: dicegroup/agdistis:$CI_BUILD_REF_NAME
IMAGE: aksw/agdistis:latest
IMAGE_DICE: dicegroup/agdistis:latest
test:
image: maven
stage: test
only:
- master
script:
- cp -r indextest index
- mvn clean test
build:
image: maven
stage: build
only:
- master
script:
- mvn clean package -Dmaven.test.skip=true
artifacts:
paths:
- target/*.war
build-docker:
image: docker:latest
stage: build-docker
services:
- docker:dind
only:
- master
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASS
script:
- docker build --pull -t $TEST_IMAGE .
- docker push $TEST_IMAGE
- docker tag $TEST_IMAGE $TEST_IMAGE_DICE
- docker push $TEST_IMAGE_DICE
test-docker:
image: docker
stage: test-docker
only:
- master
services:
- docker:dind
script:
- docker pull $TEST_IMAGE
- docker run -d --name agdistis -v `pwd`/indextest:/usr/local/tomcat/index -v `pwd`/test-docker.sh:/usr/local/tomcat/test-docker.sh $TEST_IMAGE
- sleep 30
- docker exec agdistis sh /usr/local/tomcat/test-docker.sh
release:
image: docker:latest
stage: release
services:
- docker:dind
only:
- master
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASS
script:
- docker pull $TEST_IMAGE
- docker tag $TEST_IMAGE $IMAGE
- docker push $IMAGE
- docker tag $TEST_IMAGE $IMAGE_DICE
- docker push $IMAGE_DICE