From 23e2c9890fa3bd7392d8894f75c59e0825d02480 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:11:26 +0200 Subject: [PATCH 01/49] feat: jenkins push docker imagen by branch --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 19f47c5b0..13dd7749d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,6 +89,11 @@ pipeline { sh 'pnpm install --prefer-offline --prefix=front' } } + stage('Push image') { + steps { + sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' + } + } } } stage('Stack') { @@ -183,6 +188,10 @@ pipeline { } sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker-compose push' + if (env.BRANCH_NAME == 'master') { + sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + sh 'docker push $IMAGE:latest' + } } } stage('Deploy') { -- 2.40.1 From d56c8ee3a96b6556ff864a80b60835e46a08aeb8 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:15:59 +0200 Subject: [PATCH 02/49] fix: jenkins script --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 13dd7749d..718d67bca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -188,9 +188,11 @@ pipeline { } sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker-compose push' - if (env.BRANCH_NAME == 'master') { - sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - sh 'docker push $IMAGE:latest' + script { + if (env.BRANCH_NAME == 'master') { + sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + sh 'docker push $IMAGE:latest' + } } } } -- 2.40.1 From 3224e39af794fba57a59b5912dca5240331c9597 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:20:54 +0200 Subject: [PATCH 03/49] fix: jenkins script --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 718d67bca..aaa2b1229 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,7 +91,10 @@ pipeline { } stage('Push image') { steps { + sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' + sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' + sh 'docker push $IMAGE:$BRANCH_NAME' } } } -- 2.40.1 From 15de643be7e66410e25e6933cbffaadc0eaf8a64 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:22:57 +0200 Subject: [PATCH 04/49] fix: jenkins script --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index aaa2b1229..05b99bfea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,7 +91,6 @@ pipeline { } stage('Push image') { steps { - sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' -- 2.40.1 From 566581f8aae8aff21d72b0746628e4c041792d9d Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:49:57 +0200 Subject: [PATCH 05/49] try --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 05b99bfea..6dce0ec97 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,9 +91,10 @@ pipeline { } stage('Push image') { steps { + sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' - sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' - sh 'docker push $IMAGE:$BRANCH_NAME' + // sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' + // sh 'docker push $IMAGE:$BRANCH_NAME' } } } -- 2.40.1 From fb25f67d37e1ba22866be399e7d989feb045949e Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:50:49 +0200 Subject: [PATCH 06/49] test --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6dce0ec97..7e5a3ccac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,9 +91,9 @@ pipeline { } stage('Push image') { steps { - sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' + // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' - // sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' + sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' // sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From 9b7f7cf00c2292ae1dfc36bbe66de2d2eba42d43 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:53:32 +0200 Subject: [PATCH 07/49] try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7e5a3ccac..5aa91e725 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,7 +92,7 @@ pipeline { stage('Push image') { steps { // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' - sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' + sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' // sh 'docker push $IMAGE:$BRANCH_NAME' } -- 2.40.1 From 6a2292183e6dc0511d887e806c0aa3cbc03a6216 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:55:13 +0200 Subject: [PATCH 08/49] test --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5aa91e725..f52fe4430 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -90,6 +90,9 @@ pipeline { } } stage('Push image') { + environment { + CREDENTIALS = credentials('docker-registry') + } steps { // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' -- 2.40.1 From f961bad65de9502c4869bbeeb4b84f02f4062590 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:56:19 +0200 Subject: [PATCH 09/49] echos --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index f52fe4430..7e52d1f5e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,6 +96,9 @@ pipeline { steps { // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + sh 'echo $IMAGE' + sh 'echo $TAG' + sh 'echo $BRANCH_NAME' sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' // sh 'docker push $IMAGE:$BRANCH_NAME' } -- 2.40.1 From 9a37e52bf7f14b942d57ffbd65b0113607673ef1 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:04:49 +0200 Subject: [PATCH 10/49] test --- Jenkinsfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7e52d1f5e..ec47d581d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,13 +94,8 @@ pipeline { CREDENTIALS = credentials('docker-registry') } steps { - // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'echo $IMAGE' - sh 'echo $TAG' - sh 'echo $BRANCH_NAME' - sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' - // sh 'docker push $IMAGE:$BRANCH_NAME' + sh 'docker push $IMAGE:$BRANCH_NAME' } } } -- 2.40.1 From e1aa251c55a9ecb4bab6cd9641476831c56b5a05 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:06:10 +0200 Subject: [PATCH 11/49] test --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index ec47d581d..bfb1ea0b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,6 +94,7 @@ pipeline { CREDENTIALS = credentials('docker-registry') } steps { + sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker push $IMAGE:$BRANCH_NAME' } -- 2.40.1 From 952341dc29c8c75e69eb6b12d44fe72c3ecc39f3 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:07:03 +0200 Subject: [PATCH 12/49] test --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bfb1ea0b6..395a6cbda 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,9 +94,8 @@ pipeline { CREDENTIALS = credentials('docker-registry') } steps { - sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push $IMAGE:$BRANCH_NAME' + sh 'docker push salix-back:$BRANCH_NAME' } } } -- 2.40.1 From 4d4944238e9d2e083e463313e92dc0cca302a2d9 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:12:12 +0200 Subject: [PATCH 13/49] test --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 395a6cbda..dadeb5b00 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,10 +92,12 @@ pipeline { stage('Push image') { environment { CREDENTIALS = credentials('docker-registry') + IMAGE = "$REGISTRY/verdnatura/salix-back" } steps { - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push salix-back:$BRANCH_NAME' + sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' + sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' + sh 'docker push $IMAGE:$BRANCH_NAME' } } } -- 2.40.1 From 7ff2efe6f77a696268ecf883facb4105c6e201c1 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:13:09 +0200 Subject: [PATCH 14/49] test --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dadeb5b00..c8c99821b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,7 +95,7 @@ pipeline { IMAGE = "$REGISTRY/verdnatura/salix-back" } steps { - sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' + // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker push $IMAGE:$BRANCH_NAME' } -- 2.40.1 From 26096cace8feea39837a8f49fae7ec9b589d77b0 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:14:37 +0200 Subject: [PATCH 15/49] credentials --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c8c99821b..c3f2aa3e3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,7 +96,7 @@ pipeline { } steps { // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' - sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' + sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From abe668b19e6ed709ac651fe9f57e084def53c050 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:16:28 +0200 Subject: [PATCH 16/49] build --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c3f2aa3e3..6ee9f4f85 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,8 +95,8 @@ pipeline { IMAGE = "$REGISTRY/verdnatura/salix-back" } steps { - // sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + sh 'docker-compose build back' + sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From 9432b24a19f6d7e50a46ce79b51cee8231486b7a Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:20:38 +0200 Subject: [PATCH 17/49] test --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6ee9f4f85..73a4c60e7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,6 +94,10 @@ pipeline { CREDENTIALS = credentials('docker-registry') IMAGE = "$REGISTRY/verdnatura/salix-back" } + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + } steps { sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' -- 2.40.1 From 8471b0804d36259b495d864cd44465a1a6a68465 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:21:29 +0200 Subject: [PATCH 18/49] test --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 73a4c60e7..ed132bf14 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,11 +94,11 @@ pipeline { CREDENTIALS = credentials('docker-registry') IMAGE = "$REGISTRY/verdnatura/salix-back" } - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" - } steps { + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + } sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker push $IMAGE:$BRANCH_NAME' -- 2.40.1 From 6f0f7738c4312351bf59664e57f3db16eb0eb459 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 14:27:06 +0200 Subject: [PATCH 19/49] push back --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ed132bf14..9ea529349 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,11 +97,11 @@ pipeline { steps { script { def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + env.VERSION = BRANCH_NAME } sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push $IMAGE:$BRANCH_NAME' + sh 'docker push back:$BRANCH_NAME' } } } -- 2.40.1 From dfcf4ce78a4301e94afad840cdc606194ec4c412 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 12:58:14 +0200 Subject: [PATCH 20/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9ea529349..3fb41bf4f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -101,7 +101,7 @@ pipeline { } sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push back:$BRANCH_NAME' + sh 'docker push salix-back:$BRANCH_NAME' } } } -- 2.40.1 From 17bf72022009735ee690f0317752e43c872c83cd Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:04:53 +0200 Subject: [PATCH 21/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3fb41bf4f..802027878 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -101,7 +101,7 @@ pipeline { } sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push salix-back:$BRANCH_NAME' + sh 'docker push $IMAGE:$BRANCH_NAME' } } } -- 2.40.1 From 3cca426ebac2256a889439fd0d9cedef527cb43d Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:07:54 +0200 Subject: [PATCH 22/49] feat: refs #6695 try --- Jenkinsfile | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 802027878..2e6638b58 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,21 +89,22 @@ pipeline { sh 'pnpm install --prefer-offline --prefix=front' } } - stage('Push image') { - environment { - CREDENTIALS = credentials('docker-registry') - IMAGE = "$REGISTRY/verdnatura/salix-back" - } - steps { - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = BRANCH_NAME - } - sh 'docker-compose build back' - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push $IMAGE:$BRANCH_NAME' - } + + } + } + stage('Push image') { + environment { + CREDENTIALS = credentials('docker-registry') + IMAGE = "$REGISTRY/verdnatura/salix-back" + } + steps { + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = BRANCH_NAME } + sh 'docker-compose build back' + sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + sh 'docker push $IMAGE:$BRANCH_NAME' } } stage('Stack') { -- 2.40.1 From e4400dd3e2104dcb61bf951dd0e5afeebce6fb47 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:08:46 +0200 Subject: [PATCH 23/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2e6638b58..7ed5832bf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,7 +104,7 @@ pipeline { } sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push $IMAGE:$BRANCH_NAME' + sh 'docker push back:$BRANCH_NAME' } } stage('Stack') { -- 2.40.1 From 07ce1e033f686de5fc0bf3d1d3230375899af12e Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:23:34 +0200 Subject: [PATCH 24/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7ed5832bf..2d6729040 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,7 +104,7 @@ pipeline { } sh 'docker-compose build back' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push back:$BRANCH_NAME' + sh 'docker push registry.verdnatura.es/back:$BRANCH_NAME' } } stage('Stack') { -- 2.40.1 From 251f06962b2019cdb987cf86f525d1f9d3c11681 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:24:49 +0200 Subject: [PATCH 25/49] feat: refs #6695 try --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 2d6729040..c8422ba3d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,6 +103,7 @@ pipeline { env.VERSION = BRANCH_NAME } sh 'docker-compose build back' + sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker push registry.verdnatura.es/back:$BRANCH_NAME' } -- 2.40.1 From 3b5c94433687c289381a3477cb7e7f9fe155b167 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:54:26 +0200 Subject: [PATCH 26/49] feat: refs #6695 try --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c8422ba3d..c19ea1eba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -100,12 +100,12 @@ pipeline { steps { script { def packageJson = readJSON file: 'package.json' - env.VERSION = BRANCH_NAME + env.VERSION = "${packageJson.version}-build${env.BUILD_ID}a" } sh 'docker-compose build back' sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker push registry.verdnatura.es/back:$BRANCH_NAME' + sh 'docker push $IMAGE:$BRANCH_NAME' } } stage('Stack') { -- 2.40.1 From b77cc6a360b08629464479dbad5d2b1d41e56dcb Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 13:54:58 +0200 Subject: [PATCH 27/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c19ea1eba..bb238ee04 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -100,7 +100,7 @@ pipeline { steps { script { def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}a" + env.VERSION = "${packageJson.version}-try" } sh 'docker-compose build back' sh 'docker images' -- 2.40.1 From 24a9943b0c29f3d286d73104b688451070816ea9 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:01:16 +0200 Subject: [PATCH 28/49] feat: refs #6695 try --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb238ee04..afd1018bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,12 +95,11 @@ pipeline { stage('Push image') { environment { CREDENTIALS = credentials('docker-registry') - IMAGE = "$REGISTRY/verdnatura/salix-back" } steps { script { def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-try" + env.VERSION = "e2e-try" } sh 'docker-compose build back' sh 'docker images' -- 2.40.1 From dfdf9aa2cad74bd518c74ad250c8395be0b2823b Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:04:30 +0200 Subject: [PATCH 29/49] feat: refs #6695 try --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index afd1018bd..0bd268c7a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,6 +95,8 @@ pipeline { stage('Push image') { environment { CREDENTIALS = credentials('docker-registry') + E2E_VERSION = "e2e-try" + IMAGE = "$REGISTRY/verdnatura/salix-back:$E2E_VERSION" } steps { script { -- 2.40.1 From f847e6a95a8f5bcf19737026d474d85c1e3ab728 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:13:07 +0200 Subject: [PATCH 30/49] feat: refs #6695 try --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0bd268c7a..64a59c7f6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,8 +95,7 @@ pipeline { stage('Push image') { environment { CREDENTIALS = credentials('docker-registry') - E2E_VERSION = "e2e-try" - IMAGE = "$REGISTRY/verdnatura/salix-back:$E2E_VERSION" + IMAGE = "$REGISTRY/verdnatura/salix-back" } steps { script { @@ -106,6 +105,7 @@ pipeline { sh 'docker-compose build back' sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + sh 'docker tag back:e2e-try $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From f76acd74ae879c78b3893816861618d354fbb7d2 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:14:51 +0200 Subject: [PATCH 31/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 64a59c7f6..ae29f1bdf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ pipeline { sh 'docker-compose build back' sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker tag back:e2e-try $IMAGE:$BRANCH_NAME' + sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From 33ad80ff3337102e7f6f1e5a7fa25ee1455dc877 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:16:22 +0200 Subject: [PATCH 32/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ae29f1bdf..d2ce3cd4e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ pipeline { sh 'docker-compose build back' sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME' + sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From 849a3d7fbc19b7a1c94fea3b17f91701b21607d7 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:20:17 +0200 Subject: [PATCH 33/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d2ce3cd4e..e15db30f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ pipeline { sh 'docker-compose build back' sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' + sh 'docker tag back:$VERSION $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From 6dd35aa7838ca97dc7516de100fe49346198c3f1 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:24:10 +0200 Subject: [PATCH 34/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e15db30f9..d2ce3cd4e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ pipeline { sh 'docker-compose build back' sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker tag back:$VERSION $IMAGE:$BRANCH_NAME' + sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' } } -- 2.40.1 From df74ffcb504b19c56feb2bd0e24f489ce866ea03 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:27:37 +0200 Subject: [PATCH 35/49] feat: refs #6695 try --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d2ce3cd4e..3a62f9b44 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,7 +95,7 @@ pipeline { stage('Push image') { environment { CREDENTIALS = credentials('docker-registry') - IMAGE = "$REGISTRY/verdnatura/salix-back" + IMAGE = "$REGISTRY/salix-back" } steps { script { @@ -103,7 +103,7 @@ pipeline { env.VERSION = "e2e-try" } sh 'docker-compose build back' - sh 'docker images' + // sh 'docker images' sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' sh 'docker push $IMAGE:$BRANCH_NAME' -- 2.40.1 From 72eceb685c563898e842b479dfb551c9327c2d29 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:36:20 +0200 Subject: [PATCH 36/49] feat: refs #6695 try --- Jenkinsfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a62f9b44..3d8df0d8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,15 +98,15 @@ pipeline { IMAGE = "$REGISTRY/salix-back" } steps { - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = "e2e-try" - } - sh 'docker-compose build back' - // sh 'docker images' - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' - sh 'docker push $IMAGE:$BRANCH_NAME' + // script { + // def packageJson = readJSON file: 'package.json' + // env.VERSION = "e2e-try" + // } + // sh 'docker-compose build back' + // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + // sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' + // sh 'docker push $IMAGE:$BRANCH_NAME' + sh '$GIT_BRANCH' } } stage('Stack') { -- 2.40.1 From 72cab3cc5862ced99e616a893af96e86b41f1c44 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:39:02 +0200 Subject: [PATCH 37/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d8df0d8d..6e07e24d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,7 +106,7 @@ pipeline { // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' // sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' // sh 'docker push $IMAGE:$BRANCH_NAME' - sh '$GIT_BRANCH' + sh env.GIT_BRANCH } } stage('Stack') { -- 2.40.1 From 441c41e1cc1f7febf0bf04da76571f6759617748 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:40:07 +0200 Subject: [PATCH 38/49] feat: refs #6695 try --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e07e24d7..7584fd5c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,7 +106,7 @@ pipeline { // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' // sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' // sh 'docker push $IMAGE:$BRANCH_NAME' - sh env.GIT_BRANCH + sh 'echo $GIT_BRANCH' } } stage('Stack') { -- 2.40.1 From 6700a042e242dbaf3e84d09ee043c9a6411216db Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 11 Sep 2024 14:42:02 +0200 Subject: [PATCH 39/49] feat: refs #6695 try --- Jenkinsfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7584fd5c2..45a91f89c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,15 +98,15 @@ pipeline { IMAGE = "$REGISTRY/salix-back" } steps { - // script { - // def packageJson = readJSON file: 'package.json' - // env.VERSION = "e2e-try" - // } - // sh 'docker-compose build back' - // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - // sh 'docker tag $IMAGE:$VERSION $IMAGE:$BRANCH_NAME' - // sh 'docker push $IMAGE:$BRANCH_NAME' - sh 'echo $GIT_BRANCH' + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = "e2e-try" + } + sh 'docker-compose build back' + sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + sh 'docker tag $IMAGE:$VERSION $IMAGE:$GIT_BRANCH' + sh 'docker push $IMAGE:$GIT_BRANCH' + // sh 'echo $GIT_BRANCH' } } stage('Stack') { -- 2.40.1 From 9eb16a4feb97188f89dee674ffee6552d420f15e Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 12 Sep 2024 10:25:52 +0200 Subject: [PATCH 40/49] feat: refs #6695 try --- Jenkinsfile | 1 - back/Dockerfile.test | 59 ++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 back/Dockerfile.test diff --git a/Jenkinsfile b/Jenkinsfile index 45a91f89c..4716189a9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,7 +106,6 @@ pipeline { sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker tag $IMAGE:$VERSION $IMAGE:$GIT_BRANCH' sh 'docker push $IMAGE:$GIT_BRANCH' - // sh 'echo $GIT_BRANCH' } } stage('Stack') { diff --git a/back/Dockerfile.test b/back/Dockerfile.test new file mode 100644 index 000000000..527eb8b6c --- /dev/null +++ b/back/Dockerfile.test @@ -0,0 +1,59 @@ +FROM debian:bookworm-slim +ENV TZ Europe/Madrid + +ARG DEBIAN_FRONTEND=noninteractive + +# NodeJs + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl \ + ca-certificates \ + gnupg2 \ + graphicsmagick \ + && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && corepack enable pnpm + +# Puppeteer + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libfontconfig lftp xvfb gconf-service libasound2 libatk1.0-0 libc6 \ + libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 \ + libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \ + libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \ + libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \ + libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ + fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget + +# Extra dependencies + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + samba-common-bin samba-dsdb-modules\ + && rm -rf /var/lib/apt/lists/* \ + && npm -g install pm2 + +# Salix + +WORKDIR /salix + +COPY print/package.json print/pnpm-lock.yaml print/ +RUN pnpm install --prod --prefix=print + +COPY package.json pnpm-lock.yaml ./ +COPY loopback/package.json loopback/ +RUN pnpm install --prod + +COPY loopback loopback +COPY back back +COPY modules modules +COPY print print +COPY \ + LICENSE \ + README.md \ + ./ + +CMD ["npx", "gulp", "back"] + diff --git a/docker-compose.yml b/docker-compose.yml index 923bb5780..e27071dbc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,4 @@ services: image: registry.verdnatura.es/salix-back:${VERSION:?} build: context: . - dockerfile: back/Dockerfile + dockerfile: back/Dockerfile.test -- 2.40.1 From 508214f84dd5d6f9b2786320163ccf9df6c8652c Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 16 Sep 2024 14:25:12 +0200 Subject: [PATCH 41/49] feat: refs #6695 try gulp backOnly --- back/Dockerfile.test | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/back/Dockerfile.test b/back/Dockerfile.test index 527eb8b6c..28d28f6ae 100644 --- a/back/Dockerfile.test +++ b/back/Dockerfile.test @@ -1,31 +1,23 @@ -FROM debian:bookworm-slim +FROM node:20-bullseye-slim ENV TZ Europe/Madrid ARG DEBIAN_FRONTEND=noninteractive -# NodeJs - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - ca-certificates \ - gnupg2 \ - graphicsmagick \ - && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y --no-install-recommends nodejs \ - && corepack enable pnpm # Puppeteer RUN apt-get update \ && apt-get install -y --no-install-recommends \ + gnupg2 \ + graphicsmagick \ libfontconfig lftp xvfb gconf-service libasound2 libatk1.0-0 libc6 \ libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 \ libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \ libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \ libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \ libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ - fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget + fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget \ + && corepack enable pnpm # Extra dependencies @@ -36,15 +28,15 @@ RUN apt-get update \ && npm -g install pm2 # Salix - WORKDIR /salix +RUN npm i -g gulp-cli + COPY print/package.json print/pnpm-lock.yaml print/ RUN pnpm install --prod --prefix=print COPY package.json pnpm-lock.yaml ./ COPY loopback/package.json loopback/ -RUN pnpm install --prod COPY loopback loopback COPY back back @@ -53,7 +45,13 @@ COPY print print COPY \ LICENSE \ README.md \ + gulpfile.js \ ./ -CMD ["npx", "gulp", "back"] +RUN npm install -g gulp-cli +RUN apt-get update && apt-get install -y libkrb5-dev libssl-dev +RUN pnpm install +RUN gulp install + +CMD ["pnpx", "gulp", "backOnly"] -- 2.40.1 From 691790dcd727a7eb7947658936c2b70b82626381 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 19 Sep 2024 12:33:07 +0200 Subject: [PATCH 42/49] feat: refs #6695 fix dockerFile to buil back --- .dockerignore | 3 --- back/Dockerfile.test | 29 +++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 1a47908ab..d1eb098d2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,3 @@ node_modules print/node_modules -front -db e2e -storage diff --git a/back/Dockerfile.test b/back/Dockerfile.test index 28d28f6ae..fa508b499 100644 --- a/back/Dockerfile.test +++ b/back/Dockerfile.test @@ -1,23 +1,31 @@ -FROM node:20-bullseye-slim +FROM debian:bookworm-slim ENV TZ Europe/Madrid ARG DEBIAN_FRONTEND=noninteractive +# NodeJs + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl \ + ca-certificates \ + gnupg2 \ + graphicsmagick \ + && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && corepack enable pnpm # Puppeteer RUN apt-get update \ && apt-get install -y --no-install-recommends \ - gnupg2 \ - graphicsmagick \ libfontconfig lftp xvfb gconf-service libasound2 libatk1.0-0 libc6 \ libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 \ libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \ libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \ libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \ libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ - fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget \ - && corepack enable pnpm + fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget # Extra dependencies @@ -50,8 +58,17 @@ COPY \ RUN npm install -g gulp-cli RUN apt-get update && apt-get install -y libkrb5-dev libssl-dev + +RUN apt-get update \ + && apt-get install -y build-essential python3 libssl-dev RUN pnpm install +RUN pnpm install husky + +COPY db db +COPY front front +COPY storage storage + RUN gulp install -CMD ["pnpx", "gulp", "backOnly"] +CMD ["pnpx", "gulp", "back"] -- 2.40.1 From 0d12540b035a157c8e3890c96f57bfabd53211bb Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 20 Sep 2024 13:13:45 +0200 Subject: [PATCH 43/49] feat: refs #6695 fix dockerFile to buil back --- back/Dockerfile.test | 1 + 1 file changed, 1 insertion(+) diff --git a/back/Dockerfile.test b/back/Dockerfile.test index fa508b499..4aacd13f7 100644 --- a/back/Dockerfile.test +++ b/back/Dockerfile.test @@ -54,6 +54,7 @@ COPY \ LICENSE \ README.md \ gulpfile.js \ + myt.config.yml \ ./ RUN npm install -g gulp-cli -- 2.40.1 From 1b47612c5e942ce104a4d509eb69913fe25e053e Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 25 Sep 2024 14:12:02 +0200 Subject: [PATCH 44/49] feat: refs #6695 try up db --- .dockerignore | 2 +- Jenkinsfile | 42 ++++++++++++++++++++--------------------- db/Dockerfile | 32 +++++++++++++++++++++++++++++++ docker-compose.test.yml | 22 +++++++++++++++++++++ 4 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 db/Dockerfile create mode 100644 docker-compose.test.yml diff --git a/.dockerignore b/.dockerignore index d1eb098d2..c61065e3d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ -node_modules print/node_modules +front e2e diff --git a/Jenkinsfile b/Jenkinsfile index 4716189a9..f2dd682a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -186,27 +186,27 @@ pipeline { } } } - stage('Push') { - when { - expression { RUN_BUILD } - } - environment { - CREDENTIALS = credentials('docker-registry') - } - steps { - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" - } - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker-compose push' - script { - if (env.BRANCH_NAME == 'master') { - sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - sh 'docker push $IMAGE:latest' - } - } - } + // stage('Push') { + // when { + // expression { RUN_BUILD } + // } + // environment { + // CREDENTIALS = credentials('docker-registry') + // } + // steps { + // script { + // def packageJson = readJSON file: 'package.json' + // env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + // } + // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + // sh 'docker-compose push' + // script { + // if (env.BRANCH_NAME == 'master') { + // sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + // sh 'docker push $IMAGE:latest' + // } + // } + // } } stage('Deploy') { when { diff --git a/db/Dockerfile b/db/Dockerfile new file mode 100644 index 000000000..79160940f --- /dev/null +++ b/db/Dockerfile @@ -0,0 +1,32 @@ +FROM node:20-bullseye AS base +# FROM back AS base + +ENV TZ Europe/Madrid +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libkrb5-dev libssl-dev + +RUN npm i -g pnpm + +WORKDIR /salix + +COPY db db +# COPY node_modules node_modules +COPY myt.config.yml . +# RUN ls + +RUN pnpm i @verdnatura/myt + + +FROM base AS db + +WORKDIR /salix +# RUN cat myt.config.yml +# RUN ls +# RUN cd db +# RUN ls +RUN usermod -aG docker $USER +# RUN npx myt run -d +CMD ["npx", "myt", "run", "-d"] diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 000000000..b9052cf3e --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,22 @@ +version: '3.7' +services: + front: + image: registry.verdnatura.es/salix-front:${VERSION:?} + build: + context: front + back: + image: registry.verdnatura.es/salix-back:${VERSION:?} + build: + context: . + dockerfile: back/Dockerfile + volumes: + - ./storage:/salix/storage + db: + image: db + build: + context: . + dockerfile: db/Dockerfile + target: db + volumes: + - /var/run/docker.sock:/var/run/docker.sock + user: root -- 2.40.1 From 7facadec9c7f88e51a997ebd7e835528d4b723a4 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 25 Sep 2024 14:12:35 +0200 Subject: [PATCH 45/49] feat: refs #6695 try up db --- docker-compose.test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index b9052cf3e..4e85a0fbe 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -9,14 +9,14 @@ services: build: context: . dockerfile: back/Dockerfile - volumes: - - ./storage:/salix/storage + # volumes: + # - ./storage:/salix/storage db: image: db build: context: . dockerfile: db/Dockerfile target: db - volumes: - - /var/run/docker.sock:/var/run/docker.sock - user: root + # volumes: + # - /var/run/docker.sock:/var/run/docker.sock + # user: root -- 2.40.1 From c2598b9e806a8981b344941d41f22478609ec33f Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 25 Sep 2024 14:15:45 +0200 Subject: [PATCH 46/49] feat: refs #6695 try up db --- Jenkinsfile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f2dd682a2..91be940b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,22 +92,22 @@ pipeline { } } - stage('Push image') { - environment { - CREDENTIALS = credentials('docker-registry') - IMAGE = "$REGISTRY/salix-back" - } - steps { - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = "e2e-try" - } - sh 'docker-compose build back' - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker tag $IMAGE:$VERSION $IMAGE:$GIT_BRANCH' - sh 'docker push $IMAGE:$GIT_BRANCH' - } - } + // stage('Push image') { + // environment { + // CREDENTIALS = credentials('docker-registry') + // IMAGE = "$REGISTRY/salix-back" + // } + // steps { + // script { + // def packageJson = readJSON file: 'package.json' + // env.VERSION = "e2e-try" + // } + // sh 'docker-compose build back' + // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + // sh 'docker tag $IMAGE:$VERSION $IMAGE:$GIT_BRANCH' + // sh 'docker push $IMAGE:$GIT_BRANCH' + // } + // } stage('Stack') { parallel { stage('Back') { -- 2.40.1 From 85a804001fc5384100103173af6017864ba60b04 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 25 Sep 2024 14:17:01 +0200 Subject: [PATCH 47/49] feat: refs #6695 try up db --- Jenkinsfile | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 91be940b2..7130d95aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -186,27 +186,27 @@ pipeline { } } } - // stage('Push') { - // when { - // expression { RUN_BUILD } - // } - // environment { - // CREDENTIALS = credentials('docker-registry') - // } - // steps { - // script { - // def packageJson = readJSON file: 'package.json' - // env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" - // } - // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - // sh 'docker-compose push' - // script { - // if (env.BRANCH_NAME == 'master') { - // sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - // sh 'docker push $IMAGE:latest' - // } - // } - // } + stage('Push') { + when { + expression { RUN_BUILD } + } + environment { + CREDENTIALS = credentials('docker-registry') + } + steps { + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + } + sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + sh 'docker-compose push' + script { + if (env.BRANCH_NAME == 'master') { + sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + sh 'docker push $IMAGE:latest' + } + } + } } stage('Deploy') { when { -- 2.40.1 From 7ddcb1b83f3e4e86d55189832bc91eb22b054b8d Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 30 Sep 2024 09:00:59 +0200 Subject: [PATCH 48/49] feat: refs #6695 run db in docker --- db/Dockerfile | 27 ++++++++++++--------------- docker-compose.test.yml | 15 +++++++++------ loopback/server/datasources.json | 28 ++++++++++++++-------------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/db/Dockerfile b/db/Dockerfile index 79160940f..e456ddf54 100644 --- a/db/Dockerfile +++ b/db/Dockerfile @@ -1,32 +1,29 @@ -FROM node:20-bullseye AS base -# FROM back AS base +FROM docker:dind AS base ENV TZ Europe/Madrid ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - libkrb5-dev libssl-dev +RUN apk update \ + && apk add --update nodejs npm python3 \ + krb5-dev libressl-dev + +RUN apk update \ + && apk add --virtual build-dependencies \ + build-base gcc wget git + RUN npm i -g pnpm WORKDIR /salix COPY db db -# COPY node_modules node_modules +COPY node_modules node_modules +COPY .git .git COPY myt.config.yml . -# RUN ls -RUN pnpm i @verdnatura/myt +# RUN pnpm i @verdnatura/myt FROM base AS db WORKDIR /salix -# RUN cat myt.config.yml -# RUN ls -# RUN cd db -# RUN ls -RUN usermod -aG docker $USER -# RUN npx myt run -d -CMD ["npx", "myt", "run", "-d"] diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 4e85a0fbe..4e3f88a9d 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,4 +1,3 @@ -version: '3.7' services: front: image: registry.verdnatura.es/salix-front:${VERSION:?} @@ -9,14 +8,18 @@ services: build: context: . dockerfile: back/Dockerfile - # volumes: - # - ./storage:/salix/storage + depends_on: + - db + ports: + - 3000:3000 + volumes: + - ./storage:/salix/storage db: image: db + command: npx myt run -t -d --ci -n salix_default build: context: . dockerfile: db/Dockerfile target: db - # volumes: - # - /var/run/docker.sock:/var/run/docker.sock - # user: root + volumes: + - /var/run/docker.sock:/var/run/docker.sock diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json index f1643e522..60f3f8b27 100644 --- a/loopback/server/datasources.json +++ b/loopback/server/datasources.json @@ -7,7 +7,7 @@ "connector": "vn-mysql", "database": "vn", "debug": false, - "host": "localhost", + "host": "vn-database", "port": "3306", "username": "root", "password": "root", @@ -121,19 +121,19 @@ "video/mp4" ] }, - "supplierStorage": { - "name": "supplierStorage", - "connector": "loopback-component-storage", - "provider": "filesystem", - "root": "./storage/dms", - "maxFileSize": "31457280", - "allowedContentTypes": [ - "image/png", - "image/jpeg", - "image/jpg", - "image/webp", - "video/mp4", - "application/pdf" + "supplierStorage": { + "name": "supplierStorage", + "connector": "loopback-component-storage", + "provider": "filesystem", + "root": "./storage/dms", + "maxFileSize": "31457280", + "allowedContentTypes": [ + "image/png", + "image/jpeg", + "image/jpg", + "image/webp", + "video/mp4", + "application/pdf" ] }, "accessStorage": { -- 2.40.1 From 998b8c83a7d3e2ec22a4f963db7df96852385f7c Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 30 Sep 2024 14:30:08 +0200 Subject: [PATCH 49/49] feat: refs #6695 prepare to push image --- .dockerignore | 1 + Jenkinsfile | 6 --- back/Dockerfile | 6 +++ back/Dockerfile.test | 75 -------------------------------- docker-compose.test.yml | 25 ----------- docker-compose.yml | 2 +- loopback/server/datasources.json | 2 +- 7 files changed, 9 insertions(+), 108 deletions(-) delete mode 100644 back/Dockerfile.test delete mode 100644 docker-compose.test.yml diff --git a/.dockerignore b/.dockerignore index c61065e3d..c5376b916 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ print/node_modules front e2e +storage diff --git a/Jenkinsfile b/Jenkinsfile index 7130d95aa..21dadd735 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -200,12 +200,6 @@ pipeline { } sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker-compose push' - script { - if (env.BRANCH_NAME == 'master') { - sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - sh 'docker push $IMAGE:latest' - } - } } } stage('Deploy') { diff --git a/back/Dockerfile b/back/Dockerfile index 363192a0b..82599388b 100644 --- a/back/Dockerfile +++ b/back/Dockerfile @@ -47,14 +47,20 @@ COPY loopback/package.json loopback/ RUN pnpm install --prod COPY loopback loopback +RUN rm loopback/server/datasources.json && mv loopback/server/datasources.docker.json loopback/server/datasources.json + COPY back back +COPY db db +COPY .git .git COPY modules modules COPY print print COPY \ LICENSE \ README.md \ + myt.config.yml \ ./ + CMD ["pm2-runtime", "./back/process.yml"] HEALTHCHECK --interval=15s --timeout=10s \ diff --git a/back/Dockerfile.test b/back/Dockerfile.test deleted file mode 100644 index 4aacd13f7..000000000 --- a/back/Dockerfile.test +++ /dev/null @@ -1,75 +0,0 @@ -FROM debian:bookworm-slim -ENV TZ Europe/Madrid - -ARG DEBIAN_FRONTEND=noninteractive - -# NodeJs - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - ca-certificates \ - gnupg2 \ - graphicsmagick \ - && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y --no-install-recommends nodejs \ - && corepack enable pnpm - -# Puppeteer - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - libfontconfig lftp xvfb gconf-service libasound2 libatk1.0-0 libc6 \ - libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 \ - libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \ - libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \ - libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \ - libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ - fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget - -# Extra dependencies - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - samba-common-bin samba-dsdb-modules\ - && rm -rf /var/lib/apt/lists/* \ - && npm -g install pm2 - -# Salix -WORKDIR /salix - -RUN npm i -g gulp-cli - -COPY print/package.json print/pnpm-lock.yaml print/ -RUN pnpm install --prod --prefix=print - -COPY package.json pnpm-lock.yaml ./ -COPY loopback/package.json loopback/ - -COPY loopback loopback -COPY back back -COPY modules modules -COPY print print -COPY \ - LICENSE \ - README.md \ - gulpfile.js \ - myt.config.yml \ - ./ - -RUN npm install -g gulp-cli -RUN apt-get update && apt-get install -y libkrb5-dev libssl-dev - -RUN apt-get update \ - && apt-get install -y build-essential python3 libssl-dev -RUN pnpm install -RUN pnpm install husky - -COPY db db -COPY front front -COPY storage storage - -RUN gulp install - - -CMD ["pnpx", "gulp", "back"] diff --git a/docker-compose.test.yml b/docker-compose.test.yml deleted file mode 100644 index 4e3f88a9d..000000000 --- a/docker-compose.test.yml +++ /dev/null @@ -1,25 +0,0 @@ -services: - front: - image: registry.verdnatura.es/salix-front:${VERSION:?} - build: - context: front - back: - image: registry.verdnatura.es/salix-back:${VERSION:?} - build: - context: . - dockerfile: back/Dockerfile - depends_on: - - db - ports: - - 3000:3000 - volumes: - - ./storage:/salix/storage - db: - image: db - command: npx myt run -t -d --ci -n salix_default - build: - context: . - dockerfile: db/Dockerfile - target: db - volumes: - - /var/run/docker.sock:/var/run/docker.sock diff --git a/docker-compose.yml b/docker-compose.yml index e27071dbc..923bb5780 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,4 @@ services: image: registry.verdnatura.es/salix-back:${VERSION:?} build: context: . - dockerfile: back/Dockerfile.test + dockerfile: back/Dockerfile diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json index 60f3f8b27..46017a85a 100644 --- a/loopback/server/datasources.json +++ b/loopback/server/datasources.json @@ -7,7 +7,7 @@ "connector": "vn-mysql", "database": "vn", "debug": false, - "host": "vn-database", + "host": "localhost", "port": "3306", "username": "root", "password": "root", -- 2.40.1