-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJenkinsfile
45 lines (45 loc) · 1.11 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
35
36
37
38
39
40
41
42
43
44
45
pipeline {
agent any
stages {
stage('Build') {
when {
beforeAgent true
branch 'development'
}
steps {
echo 'build'
writeFile file: "application.sh", text: "echo Built ${BUILD_ID} of ${JOB_NAME}"
archiveArtifacts 'application.sh'
gateProducesArtifact file: 'application.sh', label: 'Dummy artifact to be consumed by Deploy (master branch) gate'
}
}
stage('Test') {
when {
beforeAgent true
branch 'test'
}
steps {
script{
if (fileExists('../helloworld-api/development')) {
copyArtifacts projectName: '../helloworld-api/development'
gateConsumesArtifact file: 'application.sh'
}
}
}
}
stage('Deploy') {
when {
beforeAgent true
branch 'master'
}
steps {
script{
if (fileExists('../helloworld-api/development')) {
copyArtifacts projectName: '../helloworld-api/development'
gateConsumesArtifact file: 'application.sh'
}
}
}
}
}
}