-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
54 lines (49 loc) · 1.71 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
image: maven:3-eclipse-temurin-17
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
cache:
paths:
- .m2/repository
production build:
stage: build
script:
- apt-get update -y
- apt-get install -y ghostscript imagemagick webp
- if [ -e "../avalanche-warning-maps" ]; then rm -rf ../avalanche-warning-maps; fi
- git clone --depth 1 https://gitlab.com/albina-euregio/avalanche-warning-maps.git ../avalanche-warning-maps/
- mvn $MAVEN_CLI_OPTS --activate-profiles env-prod install
artifacts:
when: always
paths:
- target/albina.war
reports:
junit:
- target/surefire-reports/TEST-*.xml
- target/failsafe-reports/TEST-*.xml
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy to development:
stage: deploy
script:
- export TOMCAT_PATH=/albina_dev
- export GIT_VERSION=$(git describe --tags)
- mvn $MAVEN_CLI_OPTS --activate-profiles env-dev tomcat7:deploy -Dmaven.test.skip=true
environment:
name: development
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- when: manual
deploy to production:
stage: deploy
script:
- export TOMCAT_PATH=/albina
- export GIT_VERSION=$(git describe --tags)
- mvn $MAVEN_CLI_OPTS --activate-profiles env-prod tomcat7:deploy -Dmaven.test.skip=true
environment:
name: production
only:
- tags
when: manual