-
Notifications
You must be signed in to change notification settings - Fork 20
/
.gitlab-ci.yml
86 lines (74 loc) · 2.16 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
81
82
83
84
85
86
variables:
GIT_SUBMODULE_STRATEGY: recursive
TZ: Europe/Berlin
#image: maven:3.9-eclipse-temurin-8
image: bellsoft/liberica-openjdk-debian:17
cache:
paths:
- ./.m2
#default:
# before_script:
stages:
- .prenotify
# - test
- release
- .postnotify
notify-github-pending:
stage: .prenotify
when: always
script:
- .ci/notify_github.sh pending
#test:
# stage: test
# script:
# - mvn -B package
# rules:
# - if: '$CI_COMMIT_BRANCH == "develop"'
Build and Deploy:
stage: release
script:
# - apt-get update -qq
# - apt-get install -y -qq ssh lib32ncurses6 lib32z1 wget tar file gnupg2 git-lfs > /dev/null
# - source /private/MServerENVS
- whoami
# - mkdir ~/.ssh
# - ssh-keyscan -p 60002 dw2.mvorg.de >> ~/.ssh/known_hosts
# - ssh-keyscan -p 60002 148.251.176.136 >> ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
- java -version
# - mvn -v
# - mvn clean
# - mvn -B package
- ./gradlew build
- ls -l build/distributions/
- cd build/distributions
- "tar -xzf MServer-${CI_COMMIT_TAG}.tar.gz"
- "cd MServer-${CI_COMMIT_TAG}"
- rm -R Copyright/ upload.xml mserver.xml STARTEN__MServer.sh STOPPEN__MServer.sh MServer.sh
- ls -l
- mkdir ../MServer
- mv * ../MServer
- cd ../MServer
- ls -l
- "test -d /var/www/res.mediathekview.de/web/MServer || mkdir /var/www/res.mediathekview.de/web/MServer"
- ls -l /var/www/res.mediathekview.de/web/MServer/
- tar -czf /var/www/res.mediathekview.de/web/MServer/MServer.tar.gz *
- 'echo "Version vorher: " && (cat /var/www/res.mediathekview.de/web/MServer/MServer.version || echo "Keine Versionsdatei vorhanden")'
- "echo \"${CI_COMMIT_TAG}\" > /var/www/res.mediathekview.de/web/MServer/MServer.version"
- 'echo "Version jetzt: " && cat /var/www/res.mediathekview.de/web/MServer/MServer.version'
tags:
- mvweb1
rules:
- if: $CI_COMMIT_TAG == "latest"
when: never
- if: $CI_COMMIT_TAG
notify-github-success:
stage: .postnotify
when: on_success
script:
- .ci/notify_github.sh success
notify-github-failure:
stage: .postnotify
when: on_failure
script:
- .ci/notify_github.sh failure