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

Feat/unify version format #15

Merged
merged 2 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions build/azDevOps/azure/azure-pipelines-javaspring-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# NB: Some resources e.g. blob storage only allow for alpha numeric characters so the name is adjusted accordingly #
# ==> `$company$project$stage$domain` #
#############################################################################################################################
name: "$(Build.SourceBranchName)-init"
name: $(version_major).$(version_minor).$(version_patch).$(Rev:r)-$(build_type)

pr:
- main
Expand Down Expand Up @@ -63,11 +63,6 @@ stages:

- checkout: templates

# Updates the build number in Azure DevOps (requires refresh in the UI to see)
- bash: |
echo '##vso[Build.UpdateBuildNumber]${{ variables.docker_image_tag }}'
displayName: 'Update: Build Number'

# Validates all YAML files in the repo to check they adhere to standards
- template: azDevOps/azure/templates/steps/java/test-validate-yaml.yml@templates
parameters:
Expand Down Expand Up @@ -150,11 +145,6 @@ stages:

- checkout: templates

# Updates the build number in Azure DevOps (requires refresh in the UI to see)
- bash: |
echo '##vso[Build.UpdateBuildNumber]${{ variables.docker_image_tag }}'
displayName: 'Update: Build Number'

# Validates all YAML files in the repo to check they adhere to standards
- template: azDevOps/azure/templates/steps/java/test-validate-yaml.yml@templates
parameters:
Expand Down
16 changes: 8 additions & 8 deletions build/azDevOps/azure/azuredevops-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ variables:
value: 1
- name: version_minor
value: 0
- name: counter_index
- name: version_patch
value: 0
- name: build_type
${{ if eq( variables['Build.SourceBranchName'], 'main' ) }}:
value: "${{variables.version_major}}-${{variables.version_minor}}-releases"
value: "RELEASE"
${{ if ne( variables['Build.SourceBranchName'], 'main' ) }}:
value: "${{variables.version_major}}-${{variables.version_minor}}-snapshots"
- name: version_revision
value: "$[counter(variables['counter_index'], 0)]"
value: "SNAPSHOT"

# PR / Branch vars
- name: source_branch_ref
Expand All @@ -69,7 +69,7 @@ variables:
- name: docker_image_name
value: "$(self_generic_name)"
- name: docker_image_tag
value: "${{ variables.version_major }}.${{ variables.version_minor }}.$(version_revision)-$(Build.SourceBranchName)"
value: "${{ variables.version_major }}.${{ variables.version_minor }}.$(Build.BuildNumber)-$(Build.SourceBranchName)"
- name: docker_java_image
value: "azul_java"

Expand All @@ -89,9 +89,9 @@ variables:
# Maven
- name: maven_package_version
${{ if eq( variables['Build.SourceBranchName'], 'main' ) }}:
value: "${{ variables.version_major }}.${{ variables.version_minor }}.$(version_revision)"
value: "${{ variables.version_major }}.${{ variables.version_minor }}.${{ variables.version_patch }}"
${{ if ne( variables['Build.SourceBranchName'], 'main' ) }}:
value: "${{ variables.version_major }}.${{ variables.version_minor }}.$(version_revision)-SNAPSHOT"
value: "$(Build.BuildNumber)"
- name: maven_cache_directory
value: "./.m2"
- name: maven_surefire_reports_dir
Expand Down