7596-devToTest_2426 #2600
|
@ -24,6 +24,7 @@ node {
|
|||
FROM_GIT = env.JOB_NAME.startsWith('gitea/')
|
||||
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
||||
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
||||
|
||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||
|
@ -203,19 +204,23 @@ pipeline {
|
|||
sh 'npx myt push $NODE_ENV --force --commit'
|
||||
}
|
||||
}
|
||||
stage('Docker') {
|
||||
stage('Kubernetes') {
|
||||
when {
|
||||
expression { FROM_GIT }
|
||||
}
|
||||
environment {
|
||||
DOCKER_HOST = "${env.SWARM_HOST}"
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = packageJson.version
|
||||
}
|
||||
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
|
||||
withKubeConfig([
|
||||
serverUrl: "$KUBERNETES_API",
|
||||
credentialsId: 'kubernetes',
|
||||
namespace: 'salix'
|
||||
]) {
|
||||
sh 'kubectl set image deployment/salix-back-$BRANCH_NAME salix-back-$BRANCH_NAME=$REGISTRY/salix-back:$VERSION'
|
||||
sh 'kubectl set image deployment/salix-front-$BRANCH_NAME salix-front-$BRANCH_NAME=$REGISTRY/salix-front:$VERSION'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,62 +4,8 @@ services:
|
|||
image: registry.verdnatura.es/salix-front:${VERSION:?}
|
||||
build:
|
||||
context: front
|
||||
environment:
|
||||
- TZ
|
||||
- NODE_ENV
|
||||
ports:
|
||||
- 80
|
||||
deploy:
|
||||
replicas: 2
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
resources:
|
||||
limits:
|
||||
memory: 1G
|
||||
back:
|
||||
image: registry.verdnatura.es/salix-back:${VERSION:?}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: back/Dockerfile
|
||||
environment:
|
||||
- TZ
|
||||
- NODE_ENV
|
||||
- DEBUG
|
||||
ports:
|
||||
- 3000
|
||||
configs:
|
||||
- source: datasources
|
||||
target: /etc/salix/datasources.json
|
||||
- source: datasources_local
|
||||
target: /etc/salix/datasources.local.json
|
||||
- source: print
|
||||
target: /etc/salix/print.json
|
||||
- source: print_local
|
||||
target: /etc/salix/print.local.json
|
||||
volumes:
|
||||
- /mnt/appdata/pdfs:/var/lib/salix/pdfs
|
||||
- /mnt/appdata/dms:/var/lib/salix/dms
|
||||
- /mnt/appdata/image:/var/lib/salix/image
|
||||
- /mnt/appdata/vn-access:/var/lib/salix/vn-access
|
||||
deploy:
|
||||
replicas: ${BACK_REPLICAS:?}
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
resources:
|
||||
limits:
|
||||
memory: 8G
|
||||
configs:
|
||||
datasources:
|
||||
external: true
|
||||
name: salix_datasources
|
||||
datasources_local:
|
||||
external: true
|
||||
name: salix-${BRANCH_NAME:?}_datasources
|
||||
print:
|
||||
external: true
|
||||
name: salix_print
|
||||
print_local:
|
||||
external: true
|
||||
name: salix-${BRANCH_NAME:?}_print
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-back",
|
||||
"version": "24.24.0",
|
||||
"version": "24.24.1",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Salix backend",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue