Skip to content

Commit

Permalink
Move build date to build data (#258)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
  • Loading branch information
mbwhite authored Mar 10, 2021
1 parent 52d8638 commit 20db7eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions ci/templates/build-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion ci/templates/nightly-version-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ steps:
env:
COMMIT_ID: $(Build.SourceVersion)
VERSION: $(VERSION)
DATE_STAMP: $(Date:yyyyMMdd)
DATE_STAMP: $(BUILD_DATE)

0 comments on commit 20db7eb

Please sign in to comment.