script test

This commit is contained in:
Trance-0
2025-11-03 12:45:09 -06:00
parent a86f298001
commit d45e219fa4
2 changed files with 7 additions and 9 deletions

9
docker/Jenkinsfile vendored
View File

@@ -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'
}

View File

@@ -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