mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:35:50 +00:00
Update Jenkinsfile
This commit is contained in:
parent
a200b45770
commit
7eb1014e7e
1 changed files with 29 additions and 24 deletions
25
Jenkinsfile
vendored
25
Jenkinsfile
vendored
|
@ -7,7 +7,7 @@ pipeline {
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
AWS_CREDENTIAL_NAME = "AWSCredentials"
|
AWS_CREDENTIAL_NAME = "AWSCredentials"
|
||||||
REGION = "ap-northest-2"
|
REGION = "ap-northeast-2"
|
||||||
DOCKER_IMAGE_NAME = "std01-spring-petclinic"
|
DOCKER_IMAGE_NAME = "std01-spring-petclinic"
|
||||||
ECR_REPOSITORY = "257307634175.dkr.ecr.ap-northeast-2.amazonaws.com"
|
ECR_REPOSITORY = "257307634175.dkr.ecr.ap-northeast-2.amazonaws.com"
|
||||||
ECR_DOCKER_IMAGE = "${ECR_REPOSITORY}/${DOCKER_IMAGE_NAME}"
|
ECR_DOCKER_IMAGE = "${ECR_REPOSITORY}/${DOCKER_IMAGE_NAME}"
|
||||||
|
@ -29,10 +29,11 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Mvnen Build') {
|
|
||||||
|
stage('Maven Build') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Maven Build'
|
echo 'Maven Build'
|
||||||
sh 'mvn -Dmaven.test.failure.igmore=ture clean package'
|
sh 'mvn -Dmaven.test.failure.ignore=true clean package'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
|
@ -41,7 +42,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage ('Docker Image Build'){
|
stage ('Docker Image Build') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Docker Image Build'
|
echo 'Docker Image Build'
|
||||||
dir("${env.WORKSPACE}") {
|
dir("${env.WORKSPACE}") {
|
||||||
|
@ -51,31 +52,35 @@ pipeline {
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stage ('Docker Image Build'){
|
stage ('Push Docker Image to ECR') {
|
||||||
steps {
|
steps {
|
||||||
echo "Push Docker Image to ECR"
|
echo "Push Docker Image to ECR"
|
||||||
script {
|
script {
|
||||||
sh 'rm -f ~/.dockercfg~/.docker/config.json || true'
|
sh 'rm -f ~/.dockercfg~/.docker/config.json || true'
|
||||||
docker.withRegistry("http://${ECR_REPOSITORY}", "ecr"${REGION}:${AWS_CREDENTIAL_NAME}") {
|
docker.withRegistry("http://${ECR_REPOSITORY}", "ecr:${REGION}:${AWS_CREDENTIAL_NAME}") {
|
||||||
docker.image("${ECR_DOCKER_IMAGE}:latest").push()
|
docker.image("${ECR_DOCKER_IMAGE}:latest").push()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Clean Up Docker Images on Jenkins Server'){
|
stage('Clean Up Docker Images on Jenkins Server'){
|
||||||
steps {
|
steps {
|
||||||
echo 'Cleaning up unused Docker images on Jenkins server'
|
echo 'Cleaning up unused Docker images on Jenkins server'
|
||||||
sh "docker image prune -f --all --filter \"nutil=1h\""
|
sh "docker image prune -f --all --filter \"until=1h\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Upload to S3'){
|
|
||||||
|
stage('Upload to S3') {
|
||||||
|
|
||||||
}
|
}
|
||||||
stage('Codedeploy Workload'){
|
|
||||||
|
stage('Codedeploy Workload') {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue