From 3a2b0e757a3d88623b103f6e7e78896897cc1daf Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 27 May 2024 13:31:40 +0200 Subject: [PATCH] ci: refs #7442 Kubernetes deploy --- Jenkinsfile | 12 +++++++----- docker-compose.yml | 12 +----------- package.json | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7d2957a1c..7cad5ef41 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,7 +54,6 @@ pipeline { } environment { PROJECT_NAME = 'lilium' - STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}" } stages { stage('Install') { @@ -104,15 +103,18 @@ pipeline { when { expression { PROTECTED_BRANCH } } - 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: 'lilium' + ]) { + sh 'kubectl set image deployment/lilium-$BRANCH_NAME lilium-$BRANCH_NAME=$REGISTRY/salix-frontend:$VERSION' + } } } } diff --git a/docker-compose.yml b/docker-compose.yml index 6494739f2..df793fc75 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,7 @@ version: '3.7' services: main: - image: registry.verdnatura.es/salix-frontend:${BRANCH_NAME:?} + image: registry.verdnatura.es/salix-frontend:${VERSION:?} build: context: . dockerfile: ./Dockerfile - ports: - - 4000 - deploy: - replicas: ${FRONT_REPLICAS:?} - placement: - constraints: - - node.role == worker - resources: - limits: - memory: 1G diff --git a/package.json b/package.json index 7be20a842..b96159be6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.22.0", + "version": "24.22.1", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura",