forked from meanjs/mean
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
62 lines (61 loc) · 1.7 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
pipeline {
agent any
environment {
FOO = 'bar'
}
parameters {
string(name: 'Greeting', defaultValue: 'Hello', description: 'How should I greet the world?')
}
stages {
stage('Deploy Mongo Cluster') {
steps {
echo "Running ${env.JOB_NAME} build ${env.BUILD_ID} on ${env.JENKINS_URL}"
echo "${params.Greeting} World!"
echo 'Deploy Mongo Cluster..'
sh '''
cd jenkins
sh -x ./demo_run.sh -x $SCRIPT_ARGS
'''
}
}
stage('Deploy Web Cluster') {
steps {
echo 'Deploy Web Cluster..'
sh '''
cd jenkins
sh -x ./demo_run.sh -y $SCRIPT_ARGS
'''
}
}
stage('Build Web Application') {
steps {
echo 'Build Web Application....'
sh '''
cd jenkins
sh -x ./demo_run.sh $SCRIPT_ARGS
'''
}
}
}
post {
always {
echo 'This will always run'
}
success {
echo 'This will run only if successful'
// slackSend channel: '#ops-room',
// color: 'good',
// message: "The pipeline ${currentBuild.fullDisplayName} completed successfully."
}
failure {
echo 'This will run only if failed'
}
unstable {
echo 'This will run only if the run was marked as unstable'
}
changed {
echo 'This will run only if the state of the Pipeline has changed'
echo 'For example, if the Pipeline was previously failing but is now successful'
}
}
}