forked from Bansikah/quiz-app-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (44 loc) · 961 Bytes
/
.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
image: maven:latest
stages:
- build
- test
- package
- security
- deploy
build-job:
stage: build
script:
- echo "Compiling the code"
- "mvn compile"
- curl -sL https://raw.githubusercontent.com/snyk/snyk/master/install.sh | bash # Install Snyk CLI
- echo "compile complete"
security-job:
stage: security
script:
- snyk container test bansikah/quiz-app-spring-boot:v1.0
dependencies:
- build # Wait for build stage to finish before Snyk scan
test-job:
stage: test
script:
- echo "Running unit test"
- "mvn test"
package-job:
stage: test
script:
- echo "Package the code"
- "mvn package -B"
artifacts:
paths:
- target/*.jar
deploy-job:
before_script:
- apt-get update -qq && apt-get install -y -qq sshpass
stage: deploy
only:
refs:
- master
script:
- sshpass -V
- echo "Deploying application...."
- echo "Application successfully deployed!"