-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathJenkinsfileProductionRelease
64 lines (57 loc) · 2 KB
/
JenkinsfileProductionRelease
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
62
63
64
library(
identifier: "jenkins-common-lib@master",
retriever: modernSCM(github(credentialsId: "github-app-dev", repository: "jenkins-common-lib", repoOwner: "coveo")),
changelog: false
)
node('heavy && linux && docker') {
def commitHash = params.packageName.substring(params.packageName.lastIndexOf('/') + 1)
checkout([
$class: 'GitSCM',
branches: [[name: commitHash ]],
extensions: [],
userRemoteConfigs: [[credentialsId: 'github-app-dev', url: 'https://github.com/coveo/ui-kit']]
])
dockerUtils.withDocker(image: 'node:16', args: '-e HOME=/tmp -e NPM_CONFIG_PREFIX=/tmp/.npm') {
stage('Setup') {
sh 'npm ci'
}
stage('Npm publish') {
withCredentials([
string(credentialsId: 'NPM_TOKEN', variable: 'NPM_TOKEN')]) {
sh 'echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > ~/.npmrc'
sh 'npm run promote:npm:latest'
}
}
stage('Quantic publish') {
withCredentials([
usernamePassword(credentialsId: 'github-commit-token', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_TOKEN'),
string(credentialsId: 'sfdx-auth-pkg-client-id', variable: 'SFDX_AUTH_CLIENT_ID'),
file(credentialsId: 'sfdx-auth-pkg-jwt-key', variable: 'SFDX_AUTH_JWT_KEY'),
]) {
withEnv([
]) {
sh 'npx --no-install nx run quantic:"promote:sfdx:ci"'
}
}
}
stage('Notify Docs') {
withCredentials([
usernamePassword(credentialsId: 'github-commit-token', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_TOKEN')
]) {
sh 'npm run notify:docs'
}
}
stage('Cloudfront invalidation') {
withCredentials([
[
$class: "AmazonWebServicesCredentialsBinding",
credentialsId: "CloudfrontCacheInvalidation",
]
]) {
sh 'npm ci';
sh 'node ./scripts/deploy/invalidate-cloudfront.mjs'
}
}
}
}