Merge pull request '#8257 test into master' (!3288) from test into master
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-beta Build queued... Details

Reviewed-on: #3288
This commit is contained in:
Juan Ferrer 2024-12-10 10:24:08 +00:00
commit a1e53ac55b
1 changed files with 22 additions and 16 deletions

38
Jenkinsfile vendored
View File

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