forked from zmohling/worthify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
85 lines (80 loc) · 2.43 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
# Each stages executes in sequence, if previous job fails, then all the preceeding jobs are skipped.
stages:
- backend_build
- backend_deploy
# tags: "shell" should match with the tag name provided to runner, for spring runner should execute in shell.
# Notice that in petclinic project, the spring project is in root of master, if yours is in folder then cd to that folder.
backend_build:
stage: backend_build
tags:
- backend
script:
- cd Backend/serverApp
- gradle build
only:
refs:
- develop
- master
changes:
- "Backend/**/*.java"
# artifacts are created when job executes successfully, and can be manually downloaded from GitLab GUI.
# artifacts are not mandatory, buts it good practice, in case auto deploy fails, you can manually download the jar.
#maven-test:
# stage: maventest
# tags:
# - shell
# script:
# - cd Spring
# - mvn test
# artifacts:
# paths:
# - Spring/target/*.jar
# Below stage builds, deploys and executes the jar as service.
# Make sure there is /target directory in your server, else script will fail, or use any other folder you like.
# If you are changing the folder, reflect the change in systemd-web-demo service too.
backend_deploy:
stage: backend_deploy
tags:
- backend
script:
- cd Backend/serverApp
- gradle build
- sudo mv build/libs/*.jar /target/web-demo.jar
- sudo systemctl stop system-web-demo
- sudo systemctl start system-web-demo
only:
refs:
- develop
- master
changes:
- "Backend/**/*.java"
# To build android projects
# Notice that we cd into Android_test folder which contains all Android files before building apk.
# Ensure the tag matches with the tag created for Android runner
# Android runner should have docker as executor.
#android-build:
# image: javiersantos/android-ci:latest
# stage: androidbuild
# before_script:
# - export GRADLE_USER_HOME=`pwd`/.gradle
# - chmod +x ./Android_test/gradlew
# tags:
# - android_tag1
# script:
# - cd Android_test
# - ./gradlew assemble
# artifacts:
# paths:
# - Android_test/app/build/outputs/
# To run Android unit tests.
#unitTests:
# image: javiersantos/android-ci:latest
# stage: androidtest
# before_script:
# - export GRADLE_USER_HOME=`pwd`/.gradle
# - chmod +x ./Android_test/gradlew
# tags:
# - android_tag1
# script:
# - cd Android_test
# - ./gradlew test