-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
65 lines (55 loc) · 1.38 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
image: alpine
variables:
GIT_SUBMODULE_STRATEGY: recursive
PROD_ZIEL: /var/www/kodirepo.mediathekview.de/web/
stages:
- .prenotify
- testsyntax
- deploy
- .postnotify
#before_script:
notify-github-pending:
stage: .prenotify
when: always
script:
- apk add --update --no-cache bash
- .ci/notify_github.sh pending
deploy2prod:
stage: deploy
environment: production
script:
- "echo Vorherige Dateien:"
- ls -la $PROD_ZIEL
- echo Lösche alte Dateien am '${PROD_ZIEL}' ...
- rm -r ${PROD_ZIEL}* || echo "Keine Dateien vorhanden"
- echo Deploye Webseite nach '${PROD_ZIEL}' ...
- cp -r * $PROD_ZIEL
- echo "Passe Rechte auf (www-data) an..."
- "chown -R 33: $PROD_ZIEL"
- "echo Endstand am Ziel:"
- ls -la $PROD_ZIEL
only:
- master
tags:
- mvweb1
test:
stage: testsyntax
script:
- echo "Prüfe xml Syntax"
- apk add --update --no-cache libxml2-utils unzip
- xmllint --noout source/*/*.xml
- xmllint --noout webroot/*/*.xml
- xmllint --noout webroot/*/*/*.xml
- find . -name '*.zip' -exec unzip -t {} \;
notify-github-success:
stage: .postnotify
when: on_success
script:
- apk add --update --no-cache bash
- .ci/notify_github.sh success
notify-github-failure:
stage: .postnotify
when: on_failure
script:
- apk add --update --no-cache bash
- .ci/notify_github.sh failure