-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated release pipeline script to create tags for releases off patch branches in the format: 20190730.1-patch1 #382
Conversation
… branches in the format: 20190730.1-patch1
da979e7
to
9abf703
Compare
b49ff4e
to
833064a
Compare
e5f7f05
to
f024e89
Compare
@@ -6,6 +6,7 @@ declare -r __REPO_DIR=$( cd $( dirname "$0" ) && cd .. && pwd ) | |||
# VSTS environment variables | |||
declare -r BUILD_NUMBER="$BUILD_BUILDNUMBER" | |||
declare -r BUILD_CONFIGURATION="${BUILDCONFIGURATION:-Debug}" | |||
declare -r RELEASE_TAG_NAME="${RELEASE_TAG_NAME:-$BUILD_NUMBER}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for non-CI builds we would default to build number as usual
@@ -92,7 +94,7 @@ function buildDockerImage() { | |||
# Retag build image with build number tags | |||
if [ "$AGENT_BUILD" == "true" ] | |||
then | |||
uniqueTag="$BUILD_DEFINITIONNAME.$BUILD_NUMBER" | |||
uniqueTag="$BUILD_DEFINITIONNAME.$RELEASE_TAG_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value in release tag name would either just be a build number or buildnumber-patchnumber depending on whether this is a CI build or not and if it is being built in a patch branch or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add these PR comments as actual comments in the code? They really help understand what is going on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do
# Build an image that runs `pack` | ||
echo "-> Building pack runner image: $ACR_PACK_IMAGE_REPO" | ||
echo | ||
cd "$BUILD_IMAGES_BUILD_CONTEXT_DIR" | ||
docker build -f "$PACK_IMAGE_DOCKERFILE" $noCacheFlag \ | ||
--build-arg BUILD_NUMBER="$BUILD_NUMBER" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not being used
@@ -5,6 +5,30 @@ variables: | |||
- group: Oryx | |||
|
|||
stages: | |||
- stage: CreateReleaseTag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea is to create the release tag name and use it across all stages in the pipeline but it seems ADO does not have a in-built way to pass in data between stages , so here I am writing out the release tag name to an artifact file which will be later read and set as environment variable in other stages.
|
||
# Increment patch numbers until we find one for which we have not created a release already | ||
while true; do | ||
patchNumber=$((patchNumber + 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.