diff --git a/Jenkinsfile b/Jenkinsfile index ed1fcae..4915b11 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,8 @@ pipeline { stages { stage('Checkout') { steps { - setEnv() + echo "NODE_NAME: ${env.NODE_NAME}" + echo "WORKSPACE: ${env.WORKSPACE}" } } stage('Build') { @@ -19,6 +20,10 @@ pipeline { CREDENTIALS = credentials('docker-registry') } steps { + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = packageJson.version + } dockerBuild() } } @@ -26,16 +31,25 @@ pipeline { when { branch 'master' } - environment { - DOCKER_HOST = "${env.SWARM_HOST}" - } steps { + script { + def packageJson = readJSON file: 'package.json' + env.VERSION = packageJson.version + } + withKubeConfig([ + serverUrl: "$KUBERNETES_API", + credentialsId: 'kubernetes', + namespace: 'support' + ]) { + sh 'kubectl set image deployment/support support=$REGISTRY/vn-support:$VERSION' + } dockerStackDeploy() } } } post { always { + setEnv() sendEmail() } } diff --git a/debian/changelog b/debian/changelog index 739e668..f5e07f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -vn-support (2.0.12) stable; urgency=low +vn-support (24.20.1) stable; urgency=low * Initial Release. diff --git a/docker-compose.yml b/docker-compose.yml index bb94ff5..e6322dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,14 +2,5 @@ version: '3.7' services: main: - image: registry.verdnatura.es/vn-support + image: registry.verdnatura.es/vn-support:${VERSION:?} build: . - ports: - - 80 - deploy: - placement: - constraints: - - node.role == worker - resources: - limits: - memory: 500M diff --git a/package.json b/package.json new file mode 100644 index 0000000..360f502 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "vn-support", + "version": "24.20.1", + "description": "Verdnatura remote support tool and download page", + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "https://gitea.verdnatura.es/vn-support" + } +} \ No newline at end of file