forked from SkeltonThatcher/spincast-todobackend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
27 lines (27 loc) · 1003 Bytes
/
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
pipeline {
agent {
docker {
image 'maven:3-alpine'
args '-v /root/.m2:/root/.m2 -p 44419:44419 --network=root_cd-tools-network'
}
}
stages {
stage('Build') {
steps {
sh 'mvn clean package'
}
}
stage('Test') {
steps {
echo 'Run tests here...'
}
}
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", "WORKSPACE=${env.JOB_NAME}"]) {
sh 'curl -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} -X PUT "${ARTIFACTORY_SERVER_URL}/artifactory/libs-snapshot-local/${WORKSPACE}/${ARTIFACT}" -T /var/jenkins_home/workspace/${WORKSPACE}/spincast-todobackend-inmemory/target/${ARTIFACT}'
}
}
}
}
}