Skip to content

Commit

Permalink
Add env to dockercopy
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Jul 9, 2022
1 parent 61fd27f commit 3eff6ba
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
15 changes: 9 additions & 6 deletions jenkins/docker/docker-copy.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ pipeline {
options {
timeout(time: 30)
}
agent none
agent none
environment {
DATA_PREPPER_STAGING_CONTAINER_REPOSITORY = credentials('jenkins-data-prepper-staging-container-repository')
}
parameters {
choice(
name: 'SOURCE_IMAGE_REGISTRY',
name: 'SOURCE_IMAGE_REGISTRY',
choices: ['opensearchstaging', 'public.ecr.aws/opensearchstaging', 'opensearchproject', 'public.ecr.aws/opensearchproject', "${DATA_PREPPER_STAGING_CONTAINER_REPOSITORY}"],
description: 'Choose the source image registry'
)
Expand All @@ -17,7 +20,7 @@ pipeline {
trim: true
)
choice(
name: 'DESTINATION_IMAGE_REGISTRY',
name: 'DESTINATION_IMAGE_REGISTRY',
choices: ['opensearchstaging', 'public.ecr.aws/opensearchstaging', 'opensearchproject', 'public.ecr.aws/opensearchproject'],
description: 'Choose the destination image registry'
)
Expand All @@ -28,7 +31,7 @@ pipeline {
)
}
stages {
stage("Image Copy") {
stage('Image Copy') {
agent {
docker {
label 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host'
Expand Down Expand Up @@ -60,15 +63,15 @@ pipeline {
}
}
}
}
}
post() {
always {
script {
postCleanup()
sh "docker logout ${DESTINATION_IMAGE_REGISTRY} && docker image prune -f --all"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker-copy.legacySCM(groovy.lang.Closure)
docker-copy.library({identifier=jenkins@20211123, retriever=null})
docker-copy.pipeline(groovy.lang.Closure)
docker-copy.credentials(jenkins-data-prepper-staging-container-repository)
docker-copy.timeout({time=30})
docker-copy.echo(Executing on agent [label:none])
docker-copy.stage(Parameters Check, groovy.lang.Closure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker-copy.legacySCM(groovy.lang.Closure)
docker-copy.library({identifier=jenkins@20211123, retriever=null})
docker-copy.pipeline(groovy.lang.Closure)
docker-copy.credentials(jenkins-data-prepper-staging-container-repository)
docker-copy.timeout({time=30})
docker-copy.echo(Executing on agent [label:none])
docker-copy.stage(Parameters Check, groovy.lang.Closure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker-copy.legacySCM(groovy.lang.Closure)
docker-copy.library({identifier=jenkins@20211123, retriever=null})
docker-copy.pipeline(groovy.lang.Closure)
docker-copy.credentials(jenkins-data-prepper-staging-container-repository)
docker-copy.timeout({time=30})
docker-copy.echo(Executing on agent [label:none])
docker-copy.stage(Parameters Check, groovy.lang.Closure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker-copy.legacySCM(groovy.lang.Closure)
docker-copy.library({identifier=jenkins@20211123, retriever=null})
docker-copy.pipeline(groovy.lang.Closure)
docker-copy.credentials(jenkins-data-prepper-staging-container-repository)
docker-copy.timeout({time=30})
docker-copy.echo(Executing on agent [label:none])
docker-copy.stage(Parameters Check, groovy.lang.Closure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker-copy.legacySCM(groovy.lang.Closure)
docker-copy.library({identifier=jenkins@20211123, retriever=null})
docker-copy.pipeline(groovy.lang.Closure)
docker-copy.credentials(jenkins-data-prepper-staging-container-repository)
docker-copy.timeout({time=30})
docker-copy.echo(Executing on agent [label:none])
docker-copy.stage(Parameters Check, groovy.lang.Closure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker-copy.legacySCM(groovy.lang.Closure)
docker-copy.library({identifier=jenkins@20211123, retriever=null})
docker-copy.pipeline(groovy.lang.Closure)
docker-copy.credentials(jenkins-data-prepper-staging-container-repository)
docker-copy.timeout({time=30})
docker-copy.echo(Executing on agent [label:none])
docker-copy.stage(Parameters Check, groovy.lang.Closure)
Expand Down

0 comments on commit 3eff6ba

Please sign in to comment.