-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile.groovy
More file actions
45 lines (43 loc) · 1.26 KB
/
Jenkinsfile.groovy
File metadata and controls
45 lines (43 loc) · 1.26 KB
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
#!/usr/bin/env groovy
try {
node('gp2') {
stage('Checkout') {
sh 'sudo rm -rf *'
checkout scm
}
stage('Pack & Archive') {
parallel (
client: {
dir("website") {
sh 'touch website.tar.gz && tar -zcvf website.tar.gz --exclude=website.tar.gz .'
archiveArtifacts artifacts: "website.tar.gz", fingerprint: true
}
},
server: {
dir("db_backups") {
sh 'touch db_backups.tar.gz && tar -zcvf db_backups.tar.gz --exclude=db_backups.tar.gz .'
archiveArtifacts artifacts: "db_backups.tar.gz", fingerprint: true
}
}
)
}
stage('Promote to production') {
parallel (
client: {
dir("website") {
sh "aws s3 cp website.tar.gz s3://ngdevbox/applications/rails-website/production/website.tar.gz"
}
},
server: {
dir("db_backups") {
sh "aws s3 cp db_backups.tar.gz s3://ngdevbox/applications/mysql/production/db_backups.tar.gz"
}
}
)
}
}
} catch (err)
{
currentBuild.result = "FAILURE"
throw err
}