-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
32 lines (32 loc) · 941 Bytes
/
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
pipeline {
agent { label "master" }
environment {
ECR_REGISTRY = "176153467060.dkr.ecr.us-east-1.amazonaws.com"
APP_REPO_NAME= "jokerinya/ilkrepo"
}
stages {
stage('Build Docker Image') {
steps {
sh 'docker build --force-rm -t "$ECR_REGISTRY/$APP_REPO_NAME:latest" .'
sh 'docker image ls'
}
}
stage('Push Image to ECR Repo') {
steps {
sh 'aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin "$ECR_REGISTRY"'
sh 'docker push "$ECR_REGISTRY/$APP_REPO_NAME:latest"'
}
}
stage('Run Jokerinya run') {
steps {
sh 'docker-compose up'
}
}
}
post {
always {
echo 'Deleting all local images'
sh 'docker image prune -af'
}
}
}