-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
40 lines (35 loc) · 792 Bytes
/
Copy pathJenkinsfile
File metadata and controls
40 lines (35 loc) · 792 Bytes
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
pipeline {
agent any
stages {
stage('Build Angular') {
agent {
docker {
image 'node:12.18-alpine'
args '--mount type=bind,source=/home/ec2-user/deploy,target=/deploy'
}
}
when {
expression {
env.BRANCH_NAME == 'master' || env.CHANGE_TARGET == 'master'
}
}
steps {
sh '''cd client
npm i
npm run build
cp -r dist/client/* /deploy'''
}
}
stage('Deploy to S3') {
agent {
docker {
image 'amazon/aws-cli'
args '--mount type=bind,source=/home/ec2-user/deploy,target=/deploy --interactive --entrypoint=""'
}
}
steps {
sh 'aws s3 cp /deploy s3://tasker-bucket --recursive --acl public-read '
}
}
}
}