|
1
|
|
-pages:
|
|
2
|
|
- script:
|
|
3
|
|
- - mkdir .public
|
|
4
|
|
- - cp -r * .public
|
|
5
|
|
- - mv .public public
|
|
6
|
|
- artifacts:
|
|
7
|
|
- paths:
|
|
8
|
|
- - public
|
|
|
1
|
+image: java:8u102-jdk
|
|
|
2
|
+
|
|
|
3
|
+variables:
|
|
|
4
|
+ DEVELOP: "develop"
|
|
|
5
|
+ MASTER: "master"
|
|
|
6
|
+ STAGE: "frirdobserve"
|
|
|
7
|
+
|
|
|
8
|
+stages:
|
|
|
9
|
+ - Build
|
|
|
10
|
+ - Test
|
|
|
11
|
+ - Staging
|
|
|
12
|
+ - Production
|
|
|
13
|
+
|
|
|
14
|
+.before_script_default: &before_script_default
|
|
|
15
|
+ tags:
|
|
|
16
|
+ - gitlab-org
|
|
|
17
|
+ - shared
|
|
|
18
|
+ before_script:
|
|
|
19
|
+ - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
|
|
20
|
+ - eval $(ssh-agent -s)
|
|
|
21
|
+ - ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
|
22
|
+ - mkdir -p ~/.ssh
|
|
|
23
|
+ - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
|
|
24
|
+ - (cd ~ ; git clone ssh://git@gitlab.com/maven.ultreia.io/env.git)
|
|
|
25
|
+ - . ~/env/bin/prepare-env.sh "$MAVEN_PRIVATE_KEY" "$CI_PROJECT_PATH" "$CI_PROJECT_NAME"
|
|
|
26
|
+
|
|
|
27
|
+.before_script_clone: &before_script_clone
|
|
|
28
|
+ tags:
|
|
|
29
|
+ - gitlab-org
|
|
|
30
|
+ - shared
|
|
|
31
|
+ before_script:
|
|
|
32
|
+ - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
|
|
33
|
+ - eval $(ssh-agent -s)
|
|
|
34
|
+ - ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
|
35
|
+ - mkdir -p ~/.ssh
|
|
|
36
|
+ - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
|
|
37
|
+ - (cd ~ ; git clone ssh://git@gitlab.com/maven.ultreia.io/env.git)
|
|
|
38
|
+ - . ~/env/bin/prepare-env-with-clone.sh "$MAVEN_PRIVATE_KEY" "$CI_PROJECT_PATH" "$CI_PROJECT_NAME"
|
|
|
39
|
+
|
|
|
40
|
+.env_test: &env_test
|
|
|
41
|
+ environment:
|
|
|
42
|
+ name: test
|
|
|
43
|
+
|
|
|
44
|
+.env_staging: &env_staging
|
|
|
45
|
+ environment:
|
|
|
46
|
+ name: staging
|
|
|
47
|
+
|
|
|
48
|
+.env_production: &env_production
|
|
|
49
|
+ environment:
|
|
|
50
|
+ name: production
|
|
|
51
|
+
|
|
|
52
|
+.deploy_site: &deploy_site
|
|
|
53
|
+ script:
|
|
|
54
|
+ - mvn install -DskipTests
|
|
|
55
|
+ - mvn site-deploy -DperformRelease
|
|
|
56
|
+
|
|
|
57
|
+.deploy_demo_latest: &deploy_demo_latest
|
|
|
58
|
+ stage: Test
|
|
|
59
|
+ script:
|
|
|
60
|
+ - mvn -Padd-git-commit-id-to-project-version -N
|
|
|
61
|
+ - mvn install -am -pl application-web -DskipTests -Pdeploy-demo -Dclassifier=latest
|
|
|
62
|
+
|
|
|
63
|
+build:
|
|
|
64
|
+ stage: Build
|
|
|
65
|
+ <<: *before_script_default
|
|
|
66
|
+ script:
|
|
|
67
|
+ - mvn clean verify
|
|
|
68
|
+ only:
|
|
|
69
|
+ - develop
|
|
|
70
|
+ - feature/*
|
|
|
71
|
+ except:
|
|
|
72
|
+ - triggers
|
|
|
73
|
+
|
|
|
74
|
+.test_manual: &test_manual
|
|
|
75
|
+ stage: Test
|
|
|
76
|
+ <<: *before_script_default
|
|
|
77
|
+ only:
|
|
|
78
|
+ - develop
|
|
|
79
|
+ except:
|
|
|
80
|
+ - triggers
|
|
|
81
|
+ when: manual
|
|
|
82
|
+
|
|
|
83
|
+stage:
|
|
|
84
|
+ <<: *env_staging
|
|
|
85
|
+ <<: *test_manual
|
|
|
86
|
+ <<: *before_script_clone
|
|
|
87
|
+ script:
|
|
|
88
|
+ - apt-get update -y && apt-get install libc6-i386 libx32stdc++6 -y
|
|
|
89
|
+ - . bin/create_stage.sh
|
|
|
90
|
+
|
|
|
91
|
+latest-site:
|
|
|
92
|
+ <<: *env_test
|
|
|
93
|
+ <<: *test_manual
|
|
|
94
|
+ <<: *deploy_site
|
|
|
95
|
+
|
|
|
96
|
+latest-demo:
|
|
|
97
|
+ <<: *env_test
|
|
|
98
|
+ <<: *test_manual
|
|
|
99
|
+ <<: *deploy_demo_latest
|
|
|
100
|
+
|
|
|
101
|
+.nightly: &nightly
|
|
|
102
|
+ <<: *before_script_default
|
|
|
103
|
+ only:
|
|
|
104
|
+ - triggers
|
|
|
105
|
+
|
|
|
106
|
+nightly-build:
|
|
|
107
|
+ stage: Build
|
|
|
108
|
+ <<: *nightly
|
|
|
109
|
+ script:
|
|
|
110
|
+ - apt-get update -y && apt-get install libc6-i386 libx32stdc++6 -y
|
|
|
111
|
+ - mvn clean verify -DperformRelease
|
|
|
112
|
+
|
|
|
113
|
+nightly-site:
|
|
|
114
|
+ stage: Test
|
|
|
115
|
+ <<: *env_test
|
|
|
116
|
+ <<: *nightly
|
|
|
117
|
+ <<: *deploy_site
|
|
|
118
|
+
|
|
|
119
|
+nightly-demo:
|
|
|
120
|
+ stage: Test
|
|
|
121
|
+ <<: *env_test
|
|
|
122
|
+ <<: *nightly
|
|
|
123
|
+ <<: *deploy_demo_latest
|
|
|
124
|
+
|
|
|
125
|
+.staging: &staging
|
|
|
126
|
+ stage: Staging
|
|
|
127
|
+ only:
|
|
|
128
|
+ - tags
|
|
|
129
|
+ <<: *env_staging
|
|
|
130
|
+ <<: *before_script_default
|
|
|
131
|
+
|
|
|
132
|
+staging-demo:
|
|
|
133
|
+ <<: *staging
|
|
|
134
|
+ script:
|
|
|
135
|
+ - mvn install -am -pl application-web -DskipTests -Pdeploy-demo -DperformRelease
|
|
|
136
|
+
|
|
|
137
|
+staging-site:
|
|
|
138
|
+ <<: *staging
|
|
|
139
|
+ <<: *deploy_site
|
|
|
140
|
+
|
|
|
141
|
+release:
|
|
|
142
|
+ <<: *staging
|
|
|
143
|
+ when: manual
|
|
|
144
|
+ script:
|
|
|
145
|
+ - . bin/stage_release.sh
|
|
|
146
|
+
|
|
|
147
|
+production:
|
|
|
148
|
+ stage: Production
|
|
|
149
|
+ only:
|
|
|
150
|
+ - tags
|
|
|
151
|
+ <<: *env_production
|
|
|
152
|
+ when: manual
|
|
|
153
|
+ script:
|
|
|
154
|
+ - echo "Envoyer les notifications"
|