-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
41 lines (33 loc) · 1.4 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
elifeLibrary {
stage 'Checkout'
checkout scm
stage 'Installing'
sh "npm install"
elifePullRequestOnly {
stage 'Checking dist/'
sh 'git fetch origin develop:refs/remotes/origin/develop && git diff --exit-code origin/develop...HEAD dist/'
}
stage 'Compiling'
sh "node compile.js"
// is there any check we can add here apart from the node command not failing?
elifeMainlineOnly {
stage 'Committing'
def isThereANewCommit = elifeGitAutoCommit "Regenerated dist/", "dist/"
def commit = elifeGitRevision()
stage 'Pushing to alfred/regeneration_of_dist'
// needed due to required status checks on develop branch
elifeGitMoveToBranch commit, 'alfred/regeneration_of_dist'
elifeGithubCommitStatus commit, 'success', 'continuous-integration/jenkins/pr-head', 'Alfred automated commit after regenerating dist/'
stage 'Pushing to develop'
elifeGitMoveToBranch commit, 'develop'
stage 'Publishing to master'
elifeGitMoveToBranch commit, 'master'
stage 'Downstream'
if (isThereANewCommit) {
build job: '/dependencies/dependencies-bot-lax-adaptor-update-api-raml', wait: false
build job: '/dependencies/dependencies-api-validator-python-update-api-raml', wait: false
} else {
echo "Nothing to do, latest commit is old"
}
}
}