-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
61 lines (60 loc) · 1.79 KB
/
Jenkinsfile
File metadata and controls
61 lines (60 loc) · 1.79 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
pipeline {
agent none
options {
timeout(time: 5, unit: 'MINUTES')
}
stages {
stage("Build code") {
// this stage is meant to be the caching entry point of the pipeline as it will allow us to
// implement parallel stages w cache for unit testing and integration testing.
// it also calculates global var env.BUILDNUM
agent {
kubernetes {
label 'build-' + UUID.randomUUID().toString()
inheritFrom 'default'
yamlFile './cbci-templates/fmforci.yaml'
}
}
steps{
container(name: "server", shell: 'sh') {
sh script : """
yarn --frozen-lockfile
yarn lint
yarn build
yarn test
""", label: "yarn lint, build and test"
} //end container
} //end step
post {
always {
junit checksName: 'Jest Tests', testResults: 'junit.xml'
}
}
} // end stage("End Build code")
stage("Release") {
when {
buildingTag()
}
agent {
kubernetes {
label 'release-' + UUID.randomUUID().toString()
inheritFrom 'default'
yamlFile './cbci-templates/fmforci.yaml'
}
}
steps {
container(name: "server", shell: 'sh') {
withCredentials([string(credentialsId: 'NPM-OpenFeature-publish-token', variable: 'TOKEN')]) {
sh script : """
npm set //registry.npmjs.org/:_authToken=${TOKEN}
# can we get this from the above without rebuilding?
yarn --frozen-lockfile
yarn build
yarn publish
""", label: "publish to npmjs.org"
}
} //end container
}
} // end Release
} // end stages
} // end pipeline