-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
43 lines (41 loc) · 1.2 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
//log what branch is being built
echo "${env.BRANCH_NAME}"
//SHORT SYNTAX
stage('build') {
helloWorld('Guinness')
//build stuff
echo 'fixed'
}
milestone 1
stage('test') {
checkpoint 'finished build'
//lock the selenium agents
lock(inversePrecedence: true, resource: 'selenium-firefox') {
timeout(1) {
input message: 'Do you want to execute the Selenium tests?', ok: 'Yes', submitter: 'cloudbees_admins'
}
milestone 2
node('selenium-firefox') {
sh 'java -version'
}
}
}
if(env.BRANCH_NAME=="master"){
//abort an previous run if it hasn't reached this point
stage('deploy') {
checkpoint 'tests complete'
timeout(1) {
input message: 'Do you want to deploy to production?', ok: 'Yes', submitter: 'cloudbees_admins'
}
//deploy stuff one at a time
milestone 3
echo 'Deployed'
node('docker-cloud') {
checkout scm
sh('git rev-parse HEAD > GIT_COMMIT')
git_commit=readFile('GIT_COMMIT')
short_commit=git_commit.take(7)
deployAnalytics("http://elasticsearch.jenkins.beedemo.net", "es-auth", "docker-swarm", "stage-example", "stage-example.jar", "na", new Date().format("EEE, d MMM yyyy HH:mm:ss Z"), short_commit, "Success")
}
}
}