-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
35 lines (34 loc) · 1.21 KB
/
Jenkinsfile
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
pipeline {
agent {
docker {
image 'maven:3-alpine'
args '-p 44419:44419 -v /root/.m2:/root/.m2 --network=docker_cd-tools-network'
}
}
stages {
stage('Build') {
steps {
sh 'mvn clean package'
}
}
stage('Test') {
steps {
echo 'Run tests here...'
}
}
stage('sonarqube') {
steps {
withEnv(["SONARQUBE_SERVER_URL=${SONARQUBE_SERVER}"]) {
sh './gradlew -Dsonar.host.url=${SONARQUBE_SERVER_URL} sonarqube'
}
}
}
stage('Publish Artifact') {
steps {
withEnv(["ARTIFACTORY_SERVER_URL=${env.ARTIFACTORY_SERVER}", "ARTIFACTORY_LOGIN=admin", "ARTIFACTORY_PASSWORD=password", "ARTIFACT=spincast-todobackend-inmemory-1.0.2.jar"]) {
sh 'curl -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} -X PUT "${ARTIFACTORY_SERVER_URL}/artifactory/libs-snapshot-local/todobackend-java/${ARTIFACT}" -T /var/jenkins_home/workspace/todobackend-java/spincast-todobackend-inmemory/target/${ARTIFACT}'
}
}
}
}
}