Merge pull request 'refs #8257 master into beta' (!3289) from master into beta
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3289
This commit is contained in:
Juan Ferrer 2024-12-10 10:31:30 +00:00
commit c0b12db2e0
1 changed files with 22 additions and 16 deletions

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',