Update Jenkinsfile

This commit is contained in:
2022-06-14 19:27:42 +02:00
parent 41c67cef44
commit 0fdfc7d54a
Vendored
+14 -2
View File
@@ -1,6 +1,6 @@
pipeline { pipeline {
agent { agent {
label 'docker-multiarch' label 'master'
} }
options { options {
buildDiscarder(logRotator(numToKeepStr: '5')) buildDiscarder(logRotator(numToKeepStr: '5'))
@@ -18,6 +18,19 @@ pipeline {
BUILDX_NAME = "${COMPOSE_PROJECT_NAME}" BUILDX_NAME = "${COMPOSE_PROJECT_NAME}"
} }
stages { stages {
stage('Environment') {
parallel {
stage('Versions') {
steps {
sh 'cat frontend/package.json | jq --arg BUILD_VERSION "${BUILD_VERSION}" \'.version = $BUILD_VERSION\' | sponge frontend/package.json'
sh 'echo -e "\\E[1;36mFrontend Version is:\\E[1;33m $(cat frontend/package.json | jq -r .version)\\E[0m"'
sh 'cat backend/package.json | jq --arg BUILD_VERSION "${BUILD_VERSION}" \'.version = $BUILD_VERSION\' | sponge backend/package.json'
sh 'echo -e "\\E[1;36mBackend Version is:\\E[1;33m $(cat backend/package.json | jq -r .version)\\E[0m"'
sh 'sed -i -E "s/(version-)[0-9]+\\.[0-9]+\\.[0-9]+(-green)/\\1${BUILD_VERSION}\\2/" README.md'
}
}
}
}
stage('Frontend') { stage('Frontend') {
steps { steps {
sh './scripts/frontend-build' sh './scripts/frontend-build'
@@ -129,7 +142,6 @@ pipeline {
steps { steps {
// Buildx with push from cache // Buildx with push from cache
sh "./scripts/buildx -o - - > /tmp/out.tar" sh "./scripts/buildx -o - - > /tmp/out.tar"
sh "mkdir ${env.WORKSPACE}/jenkinsOut && cp /tmp/out.tar ${env.WORKSPACE}/jenkinsOut"
} }
} }
} }