Skip to content

Commit

Permalink
moved BRANCH_ALIAS environment variable into integration testing phas…
Browse files Browse the repository at this point in the history
…e for scoping. also added a similar variable to the major release phase to reformat the release number.
  • Loading branch information
chrisveilleux committed Mar 10, 2020
1 parent 69c1795 commit 3904ab5
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ pipeline {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '5'))
}
environment {
// Some branches have a "/" in their name (e.g. feature/new-and-cool)
// Some commands, such as those tha deal with directories, don't
// play nice with this naming convention. Define an alias for the
// branch name that can be used in these scenarios.
BRANCH_ALIAS = sh(
script: 'echo $BRANCH_NAME | sed -e "s#/#_#g"',
returnStdout: true
).trim()
}
stages {
// Run the build in the against the dev branch to check for compile errors
stage('Run Integration Tests') {
Expand All @@ -27,6 +17,16 @@ pipeline {
changeRequest target: 'dev'
}
}
environment {
// Some branches have a "/" in their name (e.g. feature/new-and-cool)
// Some commands, such as those tha deal with directories, don't
// play nice with this naming convention. Define an alias for the
// branch name that can be used in these scenarios.
BRANCH_ALIAS = sh(
script: 'echo $BRANCH_NAME | sed -e "s#/#_#g"',
returnStdout: true
).trim()
}
steps {
echo 'Building Mark I Voight-Kampff Docker Image'
sh 'cp test/Dockerfile.test Dockerfile'
Expand Down Expand Up @@ -80,13 +80,23 @@ pipeline {
when {
tag "*.*.0"
}
environment {
// Tag name is usually formatted like "20.2.0" whereas skill
// branch names are usually "20.02". Reformat the tag name
// to the skill branch format so this image will be easy to find
// in the mycroft-skill repository.
SKILL_BRANCH = sh(
script: 'echo $TAG_NAME | sed -e "s/\.0//g" | sed -e "s/\./.0/g"',
returnStdout: true
).trim()
}
steps {
echo 'Building ${TAG_NAME} Docker Image for Skill Testing'
sh 'cp test/Dockerfile.test Dockerfile'
sh 'docker build \
--target voight_kampff_builder \
--build-arg platform=mycroft_mark_1 \
-t voight-kampff-skill:${TAG_NAME} .'
-t voight-kampff-mark-1:${SKILL_BRANCH} .'
}
}
}
Expand Down

0 comments on commit 3904ab5

Please sign in to comment.