-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (47 loc) · 1.42 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
pipeline{
environment {
SERVICE_NAME="rest-crud-service"
TASK_FAMILY="rest-crud-task"
IMAGE=''
}
agent any
stages {
stage('Cloning Repository'){
steps{
git([url: 'https://github.com/usamashujaat1812/rest-crud-using-aws-ecs.git', branch: 'master'])
}
}
stage('Image Build'){
steps{
script{
sh "docker build -t 935648617855.dkr.ecr.us-east-2.amazonaws.com/rest-crud-using-aws-ecs:${GIT_COMMIT} ./web-app/"
}
}
}
stage('Image Push'){
steps{
script{
docker.withRegistry('https://935648617855.dkr.ecr.us-east-2.amazonaws.com', 'ecr:us-east-2:usama'){
sh "docker push 935648617855.dkr.ecr.us-east-2.amazonaws.com/rest-crud-using-aws-ecs:${GIT_COMMIT}"
}
}
}
}
stage('Service update'){
steps{
script{
sh "chmod +x service-update.sh"
sh "./service-update.sh"
}
}
}
stage ('Cleaning Directories'){
steps{
script{
sh "docker system prune --all -f"
sh "rm -rf ./*"
}
}
}
}
}