-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathJenkinsfileProductionRelease
59 lines (53 loc) · 1.9 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
node('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']]
])
withDockerContainer(image: 'node:16', args: '-u=root -e HOME=/tmp -e NPM_CONFIG_PREFIX=/tmp/.npm') {
stage('Setup') {
sh 'npm run setup'
}
stage('Npm publish') {
withCredentials([
string(credentialsId: 'npmjs_com_token', variable: 'NPM_TOKEN')]) {
sh "echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc"
sh 'npm run npm:tag: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 'npm run build'
sh 'cd packages/quantic && ./node_modules/.bin/ts-node scripts/build/create-package.ts --remove-translations --promote --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.js'
}
}
}
}