-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
58 lines (50 loc) · 1.9 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
#!/usr/bin/env groovy
// params
def nodeLabel = 'ops-alfred3-aws'
// variables
def repositoryKey = 'html5-common'
def numToKeepStr = '10'
def eventKeyStatic
pipeline {
agent {
node { label "${nodeLabel}" }
}
tools {
nodejs 'Node 8.11.3'
}
options {
timestamps()
ansiColor('xterm')
buildDiscarder(logRotator(numToKeepStr: numToKeepStr))
}
stages {
stage('Run Main build') {
steps {
script {
echo "Run Main build"
if (env.CHANGE_BRANCH) {
echo "Branch Source Name: ${env.CHANGE_TITLE}"
echo "Branch Target Name: ${env.CHANGE_TARGET}"
echo "Commit SHA: ${env.GIT_COMMIT}"
echo "Event Key: ${eventKeyStatic}"
build job: 'Playback-Web-CI/html5-common-commits-pull-requests', parameters: [
string(name: 'commitHash', value: env.GIT_COMMIT),
string(name: 'branchNameFrom', value: env.CHANGE_BRANCH),
string(name: 'branchNameTo', value: env.CHANGE_TARGET),
string(name: 'eventKey', value: "pr")]
}
else {
echo "Branch Name: ${env.GIT_BRANCH}"
echo "Commit SHA: ${env.GIT_COMMIT}"
echo "Event Key: ${eventKeyStatic}"
build job: 'Playback-Web-CI/html5-common-commits-pull-requests', parameters: [
string(name: 'commitHash', value: env.GIT_COMMIT),
string(name: 'branchNameFrom', value: env.GIT_BRANCH),
string(name: 'eventKey', value: "commit")]
}
sh 'printenv'
}
}
}
}
}