-
Notifications
You must be signed in to change notification settings - Fork 51
/
Jenkinsfile-ECS
39 lines (33 loc) · 910 Bytes
/
Jenkinsfile-ECS
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
pipeline {
agent any
parameters {
choice choices: ['apply', 'destroy'], description: 'Select the Appropriate Action Please', name: 'action'
}
environment {
AWS_ACCESS_KEY_ID = credentials('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
AWS_DEFAULT_REGION = "eu-west-2"
}
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/ooghenekaro/nodejs-webapp.git'
}
}
stage ("terraform init") {
steps {
sh "terraform init"
}
}
stage ("plan") {
steps {
sh "terraform plan"
}
}
stage (" Action") {
steps {
sh 'terraform ${action} --auto-approve'
}
}
}
}