Browse Source

fix: sanitize branch name

develop
Apostolos Fanakis 4 years ago
parent
commit
229a1a5ecb
Signed by: Apostolof GPG Key ID: 8600B4C4163B3269
  1. 6
      jenkins/Jenkinsfile

6
jenkins/Jenkinsfile

@ -1,6 +1,7 @@
#!groovy
def cleanSlateEnabled
def sanitizedBranchName
// Package change state
def appPackageChanged
@ -84,6 +85,7 @@ pipeline {
steps {
script {
cleanSlateEnabled = sh (script: "git log -1 | grep -qE 'ci: force'", returnStatus: true)
sanitizedBranchName = "${BRANCH_NAME#*/}"
appPackageChanged = sh(script: 'bash ./jenkins/check_package_changed.sh app "$GIT_COMMIT" "$GIT_PREVIOUS_COMMIT"', returnStdout: true).trim()
contractsPackageChanged = sh(script: 'bash ./jenkins/check_package_changed.sh contracts "$GIT_COMMIT" "$GIT_PREVIOUS_COMMIT"', returnStdout: true).trim()
@ -128,7 +130,7 @@ pipeline {
--net=concordia_ganache_test_network""") { concordiaGanacheTest ->
contractsTestsImage = docker.build(
"ecentrics/concordia-contracts-tests:${BRANCH_NAME}-v${contractsPackageVersion}-b${BUILD_NUMBER}-tests",
"ecentrics/concordia-contracts-tests:${sanitizedBranchName}-v${contractsPackageVersion}-b${BUILD_NUMBER}-tests",
"-f docker/concordia-contracts/Dockerfile \
./ \
--target test \
@ -158,7 +160,7 @@ pipeline {
steps {
script {
appTestsImage = docker.build(
"ecentrics/concordia-app:${BRANCH_NAME}-v${appPackageVersion}-b${BUILD_NUMBER}-tests",
"ecentrics/concordia-app:${sanitizedBranchName}-v${appPackageVersion}-b${BUILD_NUMBER}-tests",
"-f docker/concordia-app/Dockerfile \
./ \
--target test \

Loading…
Cancel
Save