-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
56 lines (55 loc) · 1.64 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@Library('defra-shared@master') _
def arti = defraArtifactory()
def codeArtifact
pipeline {
agent any
stages {
stage('Preparation') {
steps {
script {
BUILD_TAG = buildTag.updateJenkinsJob()
withCredentials([
[
$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: 'aps-rcr-user',
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY'
]
]) {
codeArtifact = defraCodeArtifact()
}
}
}
}
stage('Build') {
steps {
script {
sh """
. /var/lib/jenkins/.bashrc && nvm install 20.17.0
npm ci
"""
}
}
}
stage('Archive distribution') {
steps {
script {
DIST_FILE = codeArtifact.createDistributionFile(env.WORKSPACE, "rcr_web")
}
}
}
stage('Upload distribution') {
steps {
script {
arti.uploadArtifact("rcr-snapshots/web/", "rcr_web", BUILD_TAG, DIST_FILE)
codeArtifact.uploadArtifact("rcr-snapshots/web/", "rcr_web", BUILD_TAG, DIST_FILE)
}
}
}
}
post {
cleanup {
cleanWs cleanWhenFailure: false
}
}
}