ci: refs #6695 update docker-compose to use dynamic image tags
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2025-02-21 13:54:37 +01:00
parent e0d0830793
commit 64549603ca
2 changed files with 52 additions and 53 deletions

101
Jenkinsfile vendored
View File

@ -80,59 +80,58 @@ pipeline {
} }
steps { steps {
sh 'pnpm install --prefer-offline' sh 'pnpm install --prefer-offline'
echo CHANGE_TARGET
} }
} }
// stage('Test') { stage('Test') {
// when { when {
// expression { !PROTECTED_BRANCH } expression { !PROTECTED_BRANCH }
// } }
// environment { environment {
// NODE_ENV = '' NODE_ENV = ''
// CI = 'true' CI = 'true'
// TZ = 'Europe/Madrid' TZ = 'Europe/Madrid'
// } }
// parallel { parallel {
// stage('Unit') { stage('Unit') {
// steps { steps {
// sh 'pnpm run test:unit:ci' sh 'pnpm run test:unit:ci'
// } }
// post { post {
// always { always {
// junit( junit(
// testResults: 'junit/vitest.xml', testResults: 'junit/vitest.xml',
// allowEmptyResults: true allowEmptyResults: true
// ) )
// } }
// } }
// } }
// stage('E2E') { stage('E2E') {
// environment { environment {
// CREDENTIALS = credentials('docker-registry') CREDENTIALS = credentials('docker-registry')
// COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}" COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
// COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ." COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
// } }
// steps { steps {
// script { script {
// def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
// sh "docker-compose ${env.COMPOSE_PARAMS} up -d" sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
// image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
// sh 'cypress run --browser chromium' sh 'cypress run --browser chromium'
// } }
// } }
// } }
// post { post {
// always { always {
// sh "docker-compose ${env.COMPOSE_PARAMS} down" sh "docker-compose ${env.COMPOSE_PARAMS} down"
// junit( junit(
// testResults: 'junit/e2e.xml', testResults: 'junit/e2e.xml',
// allowEmptyResults: true allowEmptyResults: true
// ) )
// } }
// } }
// } }
// } }
// } }
stage('Build') { stage('Build') {
when { when {
expression { PROTECTED_BRANCH } expression { PROTECTED_BRANCH }

View File

@ -1,7 +1,7 @@
version: '3.7' version: '3.7'
services: services:
back: back:
image: registry.verdnatura.es/salix-back:dev image: 'registry.verdnatura.es/salix-back:${CHANGE_TARGET:-dev}'
volumes: volumes:
- ./test/cypress/storage:/salix/storage - ./test/cypress/storage:/salix/storage
- ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json - ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json
@ -18,4 +18,4 @@ services:
- TZ - TZ
dns_search: . dns_search: .
db: db:
image: registry.verdnatura.es/salix-db:dev image: 'registry.verdnatura.es/salix-db:${CHANGE_TARGET:-dev}'