-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJenkinsfile
48 lines (48 loc) · 1.01 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
pipeline {
agent {
docker {
image 'node:lts-alpine3.10'
args '-p 3000:3000'
}
}
environment {
CI = ''
HOME = '.'
npm_config_cache = 'npm-cache'
}
stages {
stage('clear cache') {
steps {
sh 'npm cache clean --force'
}
}
stage('Delete node_modules & package-lock.json') {
steps {
sh 'rm -rf node_modules package-lock.json'
}
}
stage('Install Packages') {
steps {
sh 'npm install'
}
}
stage('Create Build Artifacts') {
steps {
sh 'npm run build'
}
}
stage('Production') {
steps {
withAWS(region:'us-east-1',credentials:'AWSCredentialsID') {
s3Delete(bucket: 'robert-connell-batch-906-frontend', path:'**/*')
s3Upload(bucket: 'robert-connell-batch-906-frontend', workingDir:'build', includePathPattern:'**/*');
}
}
}
stage('Post-Production') {
steps {
sh 'rm -rf node_modules npm-cache/_cacache'
}
}
}
}