-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
53 lines (46 loc) · 1009 Bytes
/
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
pipeline {
agent {
label 'uv_windows'
}
tools {
nodejs "node"
}
environment {
CI = false
NODE_VERSION = '14.17.5'
AWS_DEFAULT_REGION = 'ap-south-1'
DISTRIBUTION_ID = '<DISTRIBUTION_ID>'
}
stages {
stage('NPM Install') {
steps {
bat 'npm install'
}
}
stage('Build') {
steps {
script {
bat 'npm run build'
}
}
}
stage('CloudFront Deploy') {
steps {
script {
withAWS(region: AWS_DEFAULT_REGION, credentials: 'MCART_CREDS') {
s3Upload(file: 'build/', bucket:'mcart-ui-deploy', path:'')
}
}
}
}
stage('CloudFront Invalidation') {
steps {
script {
withAWS(region: AWS_DEFAULT_REGION, credentials: 'MCART_CREDS') {
cfInvalidate(distribution: DISTRIBUTION_ID, paths:['/*'], waitForCompletion: true)
}
}
}
}
}
}