From d45e219fa4962ea8b430df56143fe53ca28ca6db Mon Sep 17 00:00:00 2001 From: Trance-0 <60459821+Trance-0@users.noreply.github.com> Date: Mon, 3 Nov 2025 12:45:09 -0600 Subject: [PATCH] script test --- docker/Jenkinsfile | 9 +++++---- docker/docker-compose.yaml | 7 ++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docker/Jenkinsfile b/docker/Jenkinsfile index e5e01c9..5b11f93 100644 --- a/docker/Jenkinsfile +++ b/docker/Jenkinsfile @@ -34,7 +34,7 @@ pipeline { steps { script { echo "Building docker image ${registry}-math:${version}.${env.BUILD_ID}" - def customImage = docker.build("${registry}-math:v${version}.${env.BUILD_ID}","-f ./docker/math/Dockerfile --no-cache --progress=plain -t notenextra-math:latest .") + def customImage = docker.build("${registry}-math:v${version}.${env.BUILD_ID}","-f ./docker/math/Dockerfile --no-cache --progress=plain .") echo "Logging in to docker hub" // docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-creds') { // echo "Pushing docker image ${registry}:v${version}.${env.BUILD_ID}" @@ -48,7 +48,7 @@ pipeline { steps { script { echo "Building docker image ${registry}-cse:${version}.${env.BUILD_ID}" - def customImage = docker.build("${registry}-cse:v${version}.${env.BUILD_ID}","-f ./docker/cse/Dockerfile --no-cache --progress=plain -t notenextra-cse:latest .") + def customImage = docker.build("${registry}-cse:v${version}.${env.BUILD_ID}","-f ./docker/cse/Dockerfile --no-cache --progress=plain -t .") echo "Logging in to docker hub" // docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-creds') { // echo "Pushing docker image ${registry}:v${version}.${env.BUILD_ID}" @@ -65,8 +65,9 @@ pipeline { script { echo "Stopping existing container" sh 'docker compose -f ./docker/docker-compose.yaml down' - echo "Removing existing container" - sh 'docker compose -f ./docker/docker-compose.yaml rm -f' + echo "Reassign tags to the images" + sh 'docker tag ${registry}-math:v${version}.${env.BUILD_ID} ${registry}-math:latest' + sh 'docker tag ${registry}-cse:v${version}.${env.BUILD_ID} ${registry}-cse:latest' echo "Deploying docker image ${registry}-math:${version}.${env.BUILD_ID} and ${registry}-cse:${version}.${env.BUILD_ID} with docker compose" sh 'docker compose -f ./docker/docker-compose.yaml up -d' } diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 8585840..fa81ef3 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -1,7 +1,4 @@ name: notenextra -# variables: -# version: 1.1 -# build_id: ${env.BUILD_ID} services: # you may need to update relative directories if you move this file # default created directories is /docker/docker-compose.yaml @@ -10,7 +7,7 @@ services: context: ../ dockerfile: ./docker/math/Dockerfile tags: - - trance0/notenextra-math:${version}.${env.BUILD_ID} + - trance0/notenextra-math:latest restart: on-failure:5 ports: - 13001:4200 @@ -19,7 +16,7 @@ services: context: ../ dockerfile: ./docker/cse/Dockerfile tags: - - trance0/notenextra-cse:${version}.${env.BUILD_ID} + - trance0/notenextra-cse:latest restart: on-failure:5 ports: - 13002:4200