diff --git a/Jenkinsfile b/Jenkinsfile index 6f6b734..0a84059 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,18 +54,22 @@ pipeline { } } - stage('Run Container') { - steps { - echo 'Running container...' - // --rm cleans up; this will print "Hello, World!" to the console - sh 'docker run --rm --name my-python-app-${BUILD_NUMBER} my-python-app:${BUILD_NUMBER}' - } - } - stage('Push Image') { steps { sh 'docker push "${AWS_REGISTRY}:${IMAGE_TAG}"' } } + stage('Pull Image') { + steps { + sh 'docker pull "${AWS_REGISTRY}:${IMAGE_TAG}"' + } + } + + stage('Run Container') { + steps { + echo 'Running container...' + sh 'docker run --rm --name ${IMAGE_NAME} ${AWS_REGISTRY}:${IMAGE_TAG}' + } + } } }