Skip to content

Commit 6b68d60

Browse files
author
qtipee
committed
Adds Jenkins credentials
1 parent 249fec8 commit 6b68d60

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Jenkinsfile

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
pipeline {
2+
23
agent any
4+
35
options {
46
disableConcurrentBuilds()
57
}
8+
9+
environment {
10+
SPRING_DATASOURCE_USERNAME = credentials('SPRING_DATASOURCE_USERNAME')
11+
SPRING_DATASOURCE_PASSWORD = credentials('SPRING_DATASOURCE_PASSWORD')
12+
}
13+
614
stages {
715

816
stage('Build') {
@@ -13,15 +21,15 @@
1321
}
1422
steps {
1523
echo 'Build'
16-
sh '(cd ./jamais404/; mvn clean package)'
24+
sh '(cd ./jamais404/; mvn clean package -Dspring.profiles.active=prod)'
1725
stash name: "app", includes: "**"
1826
}
1927
}
2028

2129
stage('SonarCloud') {
2230
steps {
2331
unstash "app"
24-
sh '(cd ./jamais404/; mvn sonar:sonar'
32+
sh '(cd ./jamais404/; mvn sonar:sonar -Dspring.profiles.active=prod'
2533
}
2634
}
2735

@@ -34,7 +42,7 @@
3442
steps {
3543
echo 'Test'
3644
unstash "app"
37-
sh '(cd ./jamais404/; mvn test)'
45+
sh '(cd ./jamais404/; mvn test -Dspring.profiles.active=prod)'
3846
}
3947
}
4048
}

0 commit comments

Comments
 (0)