-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
69 lines (65 loc) · 2.06 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
stages:
- build
- deploy
- install
# 1) Build every commit on every branch and add the COMMIT SHORT SHA as suffix
maven-build:
stage: build
script:
- export MAVEN_OPTS='-Xmx128m'
- mvn clean install
artifacts:
paths:
- target/*.jar
name: ${CI_PROJECT_NAME}-${CI_COMMIT_SHORT_SHA}
# 2) Copies SNAPSHOT builds on 'master' and 'dm4' branch into download.dmx.systems/ci/ directory
copy-to-ci:
stage: deploy
script:
- CIDIR='/var/www/download.dmx.systems/ci'
- DESTDIR="${CIDIR}/${CI_PROJECT_NAME}"
- JARFILE="$( basename $( ls target/*.jar | tail -n1) )"
- NUNC="$( date +%F )"
- DESTJARFILE="$( basename ${JARFILE} .jar )_${NUNC}_${CI_PIPELINE_ID}.jar"
- if [ ! -d ${DESTDIR} ]; then mkdir ${DESTDIR}; fi
- cp target/${JARFILE} ${DESTDIR}/${DESTJARFILE}
- ln -sf ${DESTDIR}/${DESTJARFILE} ${DESTDIR}/${CI_PROJECT_NAME}-latest.jar
dependencies:
- maven-build
only:
- master
- dm4
# 3) Copies tagged RELEASE builds into download.dmx.systems/plugins/ directory
copy-to-release:
stage: deploy
script:
- RELEASEDIR='/var/www/download.dmx.systems/plugins'
- DESTDIR="${RELEASEDIR}/${CI_PROJECT_NAME}"
- JARFILE="$( basename $( ls target/*.jar | tail -n1) )"
- if [ ! -d ${DESTDIR} ]; then mkdir ${DESTDIR}; fi
- cp target/${JARFILE} ${DESTDIR}/
dependencies:
- maven-build
only:
- tags
# 4) Install in docker-container
install-in-container:
allow_failure: true
stage: install
except:
- tags
tags:
## requires shell-docker runner
- shell-docker
dependencies:
- maven-build
variables:
TIER: 'dev'
DMX_ADMIN_PASSWORD: ${DMX_ADMIN_PASSWORD}
LDAP_ADMIN_PASSWORD: ${LDAP_ADMIN_PASSWORD}
WEBDIR: 'https://download.dmx.systems/ci' # <= stable|latest
WEBCGI: 'https://download.dmx.systems/cgi-bin/v1/latest-version.cgi?' # <= stable|latest
# PLUGINS: "dmx-deepl dmx-ldap dmx-sign-up dmx-sendmail dmx-thymeleaf dmx-file-upload"
script:
## Deploy Test Container
- deploy/ci-deploy-dmx-docker-instance.sh