From 20db7eb2422c9236dfed13d459f83aefdab3757e Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Wed, 10 Mar 2021 09:43:40 +0000 Subject: [PATCH] Move build date to build data (#258) Signed-off-by: Matthew B White --- ci/azure-pipelines.yml | 5 ++++- ci/templates/build-data.yaml | 7 +++++++ ci/templates/nightly-version-update.yaml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 6ca4a8bd..8a78c59a 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -9,7 +9,7 @@ name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rrr) # Daily build for final quality # cf https://crontab.guru/#0_23_*_*_* schedules: - - cron: "0 23 * * *" + - cron: "0 10,12,14,16,23 * * *" displayName: 'Chaincode Node Nightly Driver' branches: include: @@ -68,6 +68,7 @@ stages: displayName: 'Build, lint, UT' variables: VERSION: $[ dependencies.displayenv.outputs['BuildData.PACKAGE_VERSION'] ] + BUILD_DATE: $[ dependencies.displayenv.outputs['BuildData.BUILD_DATE'] ] steps: - task: NodeTool@0 inputs: @@ -128,6 +129,7 @@ stages: dependsOn: main variables: VERSION: $[ dependencies.displayenv.outputs['BuildData.PACKAGE_VERSION'] ] + BUILD_DATE: $[ dependencies.displayenv.outputs['BuildData.BUILD_DATE'] ] steps: - task: NodeTool@0 inputs: @@ -198,6 +200,7 @@ stages: dependsOn: main variables: VERSION: $[ dependencies.displayenv.outputs['BuildData.PACKAGE_VERSION'] ] + BUILD_DATE: $[ dependencies.displayenv.outputs['BuildData.BUILD_DATE'] ] steps: - task: NodeTool@0 inputs: diff --git a/ci/templates/build-data.yaml b/ci/templates/build-data.yaml index d2ec2a12..711551fe 100644 --- a/ci/templates/build-data.yaml +++ b/ci/templates/build-data.yaml @@ -5,9 +5,16 @@ steps: VERSION=$(jq '.version' $(Build.SourcesDirectory)/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9]\.[0-9]?[0-9]).*/\1/") echo Current version in code is :${VERSION}: echo "##vso[task.setvariable variable=PACKAGE_VERSION;isOutput=true]${VERSION}" + # handle minor version MINOR_VERSION=$(jq '.version' $(Build.SourcesDirectory)/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9])\.[0-9]?[0-9].*/\1/") echo Current minor version in code is :${MINOR_VERSION}: echo "##vso[task.setvariable variable=MINOR_PACKAGE_VERSION;isOutput=true]${MINOR_VERSION}" + + # get the current date for using in dev builds + BUILD_DATE=$(date '+%Y%m%d') + echo Build date is :${BUILD_DATE} + echo "##vso[task.setvariable variable=BUILD_DATE;isOutput=true]${BUILD_DATE}" + name: BuildData displayName: 'Build data' \ No newline at end of file diff --git a/ci/templates/nightly-version-update.yaml b/ci/templates/nightly-version-update.yaml index 8be5e417..74918ee5 100644 --- a/ci/templates/nightly-version-update.yaml +++ b/ci/templates/nightly-version-update.yaml @@ -10,4 +10,4 @@ steps: env: COMMIT_ID: $(Build.SourceVersion) VERSION: $(VERSION) - DATE_STAMP: $(Date:yyyyMMdd) \ No newline at end of file + DATE_STAMP: $(BUILD_DATE) \ No newline at end of file