-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
67 lines (67 loc) · 1.72 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
57
58
59
60
61
62
63
64
65
66
67
pipeline {
agent {
docker {
image 'node:10-alpine'
args '-p 20001-20100:3000'
}
}
environment {
CI = 'true'
HOME = '.'
npm_config_cache = 'npm-cache'
}
stages {
// stage('Install ng cli') {
// steps {
// sh ' npm install -g @angular/cli'
// }
// }
stage('Install Packages') {
steps {
sh ' npm install'
}
}
stage('Test and Build') {
parallel {
stage('Run Tests') {
steps {
sh ' npm run test'
}
}
stage('Create Build Artifacts') {
steps {
sh 'npm run build'
}
}
}
}
stage('Deployment') {
parallel {
stage('Staging') {
when {
branch 'staging'
}
steps {
withAWS(region:'us-east-2',credentials:'7ad7e5c7-492e-446d-a66b-655fa041b2ca') {
s3Delete(bucket: 'fas-jenkins-test-1', path:'**/*')
s3Upload(bucket: 'fas-jenkins-test-1', workingDir:'build', includePathPattern:'**/*');
}
mail(subject: 'Staging Build', body: 'New Deployment to Staging', to: 'hris@freshairsensor.com')
}
}
stage('Production') {
when {
branch 'master'
}
steps {
withAWS(region:'us-east-2',credentials:'7ad7e5c7-492e-446d-a66b-655fa041b2ca') {
s3Delete(bucket: 'fas-jenkins-test-1', path:'**/*')
s3Upload(bucket: 'fas-jenkins-test-1', workingDir:'build', includePathPattern:'**/*');
}
mail(subject: 'Production Build', body: 'New Deployment to Production', to: 'chris@freshairsensor.com')
}
}
}
}
}
}