-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
45 lines (45 loc) · 1.44 KB
/
Copy pathJenkinsfile
File metadata and controls
45 lines (45 loc) · 1.44 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
def tagid = null
def userInput = false
pipeline{
agent any
stages{
stage("Input"){
agent none
steps{
script{
tagid = input(
message : 'Enter the Tag ID',
ok : 'Submit',
parameters : [string(defaultValue: '32' , name: 'TAG_ID')]
)
}
}
}
stage("Deploy"){
agent any
steps{
sh "docker container rm -f spring-container"
sh "docker pull public.ecr.aws/s5o7d0z2/adarsh-repo:build-${tagid}"
sh "docker run -d -p 3000:8080 --name spring-container public.ecr.aws/s5o7d0z2/adarsh-repo:build-${tagid}"
}
}
stage("Approval"){
agent none
steps{
script {
userInput = input(id: 'Proceed1', message: 'Promote build?', parameters: [[$class: 'BooleanParameterDefinition', defaultValue: true, description: '', name: 'Please confirm you agree with this']])
echo 'userInput: ' + userInput
if(userInput == true) {
} else {
echo "Action was aborted."
}
}
}
}
stage("CLEANUP"){
steps{
sh "docker image prune -a --force"
}
}
}
}