master #3299

Merged
carlosap merged 9 commits from master into test 2024-12-12 17:23:12 +00:00
1 changed files with 22 additions and 16 deletions
Showing only changes of commit 6be23a5bbb - Show all commits

38
Jenkinsfile vendored
View File

@ -64,6 +64,18 @@ pipeline {
PROJECT_NAME = 'salix' PROJECT_NAME = 'salix'
} }
stages { stages {
stage('Version') {
when {
expression { RUN_BUILD }
}
steps {
script {
def packageJson = readJSON file: 'package.json'
def version = "${packageJson.version}-build${env.BUILD_ID}"
writeFile(file: 'VERSION.txt', text: version)
}
}
}
stage('Install') { stage('Install') {
environment { environment {
NODE_ENV = '' NODE_ENV = ''
@ -120,11 +132,10 @@ pipeline {
when { when {
expression { RUN_BUILD } expression { RUN_BUILD }
} }
environment {
VERSION = readFile 'VERSION.txt'
}
steps { steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
}
sh 'docker-compose build back' sh 'docker-compose build back'
} }
} }
@ -158,11 +169,10 @@ pipeline {
when { when {
expression { RUN_BUILD } expression { RUN_BUILD }
} }
environment {
VERSION = readFile 'VERSION.txt'
}
steps { steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
}
sh 'gulp build' sh 'gulp build'
sh 'docker-compose build front' sh 'docker-compose build front'
} }
@ -177,12 +187,9 @@ pipeline {
} }
environment { environment {
CREDENTIALS = credentials('docker-registry') CREDENTIALS = credentials('docker-registry')
VERSION = readFile 'VERSION.txt'
} }
steps { 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 login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
sh 'docker-compose push' sh 'docker-compose push'
} }
@ -209,11 +216,10 @@ pipeline {
when { when {
expression { FROM_GIT } expression { FROM_GIT }
} }
environment {
VERSION = readFile 'VERSION.txt'
}
steps { steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
}
withKubeConfig([ withKubeConfig([
serverUrl: "$KUBERNETES_API", serverUrl: "$KUBERNETES_API",
credentialsId: 'kubernetes', credentialsId: 'kubernetes',