-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
75 lines (70 loc) · 3.17 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
stages: # these stages (jobs) forms the CICD pipeline
- mavenbuild # this is a JOB to build your Springboot application
- maventest # this is a JOB to run tests in your Springboot application (it's okay you don't have any test for now)
- mavendeploy # this is a JOB to deploy your Springboot application on your server
- androidbuild # this is a JOB to build your Android application
- androidtest # this is a JOB to run tests in your Android application (it's okay you don't have any test for now)
maven-build:
stage: mavenbuild # one of the stages listed above
tags: # to specify which runner to execute this job
- spring # change to your runner's tag
script: # what to execute for this job
- cd Backend # change 'Backend' to to where you have the pom.xml (do not add / in the beginning)
- mvn package # maven package
artifacts: # where to output the packaged jar file, change 'Backend' to to where you have the pom.xml
paths:
- Backend/target/*.jar
maven-test:
stage: maventest # one of the stages listed above
tags:
- spring # change to your runner's tag
script:
- cd Backend # change 'Backend' to to where you have the pom.xml (do not add / in the beginning)
- mvn test # maven test
auto-deploy:
stage: mavendeploy # one of the stages listed above
tags:
- spring # change to your runner's tag
only:
- main
script: # script to run the deployment service you created
- cd Backend # change 'Backend' to to where you have the pom.xml (do not add / in the beginning)
- sudo mv target/*.jar /target/web-demo.jar
- sudo systemctl stop system-web-demo
- sudo systemctl start system-web-demo
android-build:
image: afirefly/android-ci:java17 # Docker image that has Android environments installed
stage: androidbuild # one of the stages listed above
cache:
paths:
- .gradle/caches
- .gradle/wrapper
tags:
- android
retry:
max: 2
when: always # change to your runner's tag
before_script: # enable gradlew, change 'Frontend' to where you have 'gradlew'
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./Frontend/dinder/gradlew
script:
- cd Frontend/dinder # change 'Frontend' to where you have 'gradlew' (do not add / in the beginning)
- ./gradlew build # gradle build
android-test:
image: afirefly/android-ci:java17
stage: androidtest # one of the stages listed above
cache:
paths:
- .gradle/caches
- .gradle/wrapper
tags:
- android # change to your runner's tag
retry:
max: 2
when: always
before_script: # enable gradlew, change 'Frontend' to where you have 'gradlew'
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./Frontend/dinder/gradlew
script:
- cd Frontend/dinder # change 'Frontend' to where you have 'gradlew' (do not add / in the beginning)
- ./gradlew test # gradle test