diff --git a/Jenkinsfile b/Jenkinsfile index 4ad1a48..5a49ee8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,8 +37,6 @@ pipeline { stage('Deploy') { steps { echo 'Stopping and removing old containers...' - // 1. Stop and remove the old running containers (if they exist) - // The || true prevents the build from failing if the container doesn't exist yet sh "docker stop ${VUE_CONTAINER_NAME} || true" sh "docker rm ${VUE_CONTAINER_NAME} || true" sh "docker stop ${FLASK_CONTAINER_NAME} || true" @@ -49,14 +47,12 @@ pipeline { sh "docker network create ${NETWORK_NAME}" - echo "Starting new containers named ${VUE_CONTAINER_NAME} and ${FLASK_CONTAINER_NAME}... from images ${FRONTEND_IMAGE} and ${BACKEND_IMAGE}" + echo "Starting new containers" - // 2. Start the newly built images - // You must customize the ports (-p) and environment variables (-e) as needed sh """ docker run -d \\ --name ${VUE_CONTAINER_NAME} \\ - --network ${NETWORK_NAME}" \\ + --network ${NETWORK_NAME} \\ -p 443:443 \\ ${FRONTEND_IMAGE} """ @@ -64,7 +60,7 @@ pipeline { sh """ docker run -d \\ --name ${FLASK_CONTAINER_NAME} \\ - --network ${NETWORK_NAME}" \\ + --network ${NETWORK_NAME} \\ ${BACKEND_IMAGE} """