Skip to content
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

Merged
merged 4 commits into from
Oct 14, 2019

Conversation

kichalla
Copy link
Contributor

@kichalla kichalla commented Oct 7, 2019

No description provided.

@kichalla kichalla requested a review from a team as a code owner October 7, 2019 23:28
@kichalla kichalla force-pushed the kichalla/patch.releases branch 2 times, most recently from b49ff4e to 833064a Compare October 10, 2019 19:20
@@ -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}"
Copy link
Contributor Author

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"
Copy link
Contributor Author

@kichalla kichalla Oct 14, 2019

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.

Copy link
Member

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

Copy link
Contributor Author

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" \
Copy link
Contributor Author

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
Copy link
Contributor Author

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))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample releases created with these changes:
image

@kichalla kichalla merged commit a3f4441 into master Oct 14, 2019
@kichalla kichalla deleted the kichalla/patch.releases branch October 14, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants