forked from paypal/paypal-messaging-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
39 lines (38 loc) · 1.25 KB
/
Jenkinsfile
File metadata and controls
39 lines (38 loc) · 1.25 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
pipeline {
agent {
label 'mesos'
}
tools {
nodejs 'Node10'
}
environment {
GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
GIT_COMMIT_MESSAGE = sh(returnStdout: true, script: 'git log -1 --pretty=%B').trim()
}
stages {
stage('Publish') {
when {
expression {
return env.GIT_COMMIT_MESSAGE =~ /^chore\(release\): \d+\.\d+\.\d+/
}
}
steps {
checkout scm
sh '''
echo "GIT_BRANCH: $GIT_BRANCH"
node -v
npm -v
npm set registry https://npm.paypal.com
npm i -g @paypalcorp/web
'''
withCredentials([usernamePassword(credentialsId: 'web-cli-creds', passwordVariable: 'SVC_ACC_PASSWORD', usernameVariable: 'SVC_ACC_USERNAME')]) {
sh '''
OUTPUT=$(web stage --json)
BUNDLE_ID=$(node -e 'console.log(JSON.parse(process.argv[1]).id)' "$OUTPUT")
web notify $BUNDLE_ID
'''
}
}
}
}
}