-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
58 lines (58 loc) · 1.25 KB
/
Copy pathJenkinsfile
File metadata and controls
58 lines (58 loc) · 1.25 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
46
47
48
49
50
51
52
53
54
55
56
57
58
pipeline {
agent any
stages {
stage('build') {
steps {
sh 'virtualenv .venv'
sh """
source .venv/bin/activate
pip install -r requirements.txt
pip install wheel
python setup.py bdist_wheel
"""
}
}
stage('test') {
steps {
sh """
source .venv/bin/activate
python my_application/test.py
"""
}
post {
always {
junit 'test-reports/*.xml'
}
}
}
stage('uploadBinaryToS3') {
steps {
sh """
source .venv/bin/activate
pwd
ls
aws s3 cp dist/my_application-*.whl s3://test-ankur/users/temp/
"""
}
}
stage('deploy') {
steps {
sh """
terraform -v
cd terraform
terraform init
terraform plan -out plan.out
terraform apply -auto-approve plan.out
terraform plan -destroy -out planfile
aws s3 cp plan.out s3://test-ankur/users/temp/
aws s3 cp planfile s3://test-ankur/users/temp/
"""
}
}
}
post {
always {
cleanWs()
}
}
}