-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
109 lines (95 loc) · 2.28 KB
/
Jenkinsfile
File metadata and controls
109 lines (95 loc) · 2.28 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
pipeline {
agent any
stages {
stage('Build') {
parallel {
stage('Build') {
steps {
alaudaStartBuild(buildConfigName: 'hello-world', async: true, branch: 'master', commitID: '4dbbebb1a2e3234d7cfec1e1485d4463fcd3020d')
}
}
stage('') {
steps {
sh 'echo XXXXX'
}
}
}
}
stage('Parallel Stage') {
when {
branch 'master'
}
parallel {
stage('Update Service') {
steps {
sh 'Update the service...'
}
}
stage('Deploy an application') {
steps {
sh 'Deploy an application...'
}
}
}
}
stage('Deploy - Staging') {
steps {
echo './deploy staging'
echo './run-smoke-tests'
script {
def browsers = ['chrome', 'firefox', 'opera']
for (int i = 0; i < browsers.size(); ++i) {
echo "Testing the ${browsers[i]} browser"
}
}
}
}
stage('Sanity check') {
steps {
input 'Does the staging environment look ok?'
}
}
stage('Deploy - Production') {
when {
expression {
currentBuild.result == null || currentBuild.result == 'SUCCESS'
}
}
steps {
echo './deploy production'
}
}
}
environment {
DEPLOY_TO = 'production'
}
post {
always {
echo 'One way or another, I have finished'
}
success {
echo 'I am successed!'
}
unstable {
echo 'I am unstable :/'
}
failure {
echo 'I am failed :('
}
aborted {
echo 'I am aborted...'
}
changed {
echo 'Things were different before...'
}
}
options {
timeout(time: 1, unit: 'HOURS')
}
parameters {
string(name: 'person', defaultValue: 'sywang', description: 'Who should I say hello to?')
string(name: 'repoUrl', defaultValue: 'https://github.com/sniperyen/hello-world', description: 'git代码路径')
string(name: 'repoBranch', defaultValue: 'master', description: 'git分支名称')
string(name: 'dockerfilePath', defaultValue: 'Dockerfile', description: '相对路径')
}
}