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

Update OB Build Pipeline to Pass Build Tag as Var #2011

Merged
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
27 changes: 14 additions & 13 deletions .pipelines/onebranch/pipeline.buildrp.official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,20 @@ extends:
suppressionSet: default

stages:
- stage: Build_ARO
jobs:
- job: Build_ARO
pool:
type: linux

variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
ob_outputDirectory: $(Build.SourcesDirectory)/out # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts

steps:
- template: .pipelines/onebranch/templates/template-buildrp-buildaro.yml@self

- stage: Build_Docker_Image
dependsOn: Build_ARO
jobs:
- job: Build_Docker_Image
pool:
Expand All @@ -56,19 +69,7 @@ extends:

variables:
ob_git_checkout: true
release_tag: $[stageDependencies.Build_ARO.Build_ARO.outputs['buildaro.releasetag']]

steps:
- template: .pipelines/onebranch/templates/template-buildrp-builddocker.yml@self


- stage: Build_ARO
jobs:
- job: Build_ARO
pool:
type: linux

variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
ob_outputDirectory: $(Build.SourcesDirectory)/out # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts

steps:
- template: .pipelines/onebranch/templates/template-buildrp-buildaro.yml@self
27 changes: 14 additions & 13 deletions .pipelines/onebranch/pipeline.buildrp.pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,20 @@ extends:
suppressionSet: default

stages:
- stage: Build_ARO
jobs:
- job: Build_ARO
pool:
type: linux

variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
ob_outputDirectory: $(Build.SourcesDirectory)/out # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts

steps:
- template: .pipelines/onebranch/templates/template-buildrp-buildaro.yml@self

- stage: Build_Docker_Image
dependsOn: Build_ARO
jobs:
- job: Build_Docker_Image
pool:
Expand All @@ -56,19 +69,7 @@ extends:

variables:
ob_git_checkout: true
release_tag: $[stageDependencies.Build_ARO.Build_ARO.outputs['buildaro.releasetag']]

steps:
- template: .pipelines/onebranch/templates/template-buildrp-builddocker.yml@self


- stage: Build_ARO
jobs:
- job: Build_ARO
pool:
type: linux

variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
ob_outputDirectory: $(Build.SourcesDirectory)/out # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts

steps:
- template: .pipelines/onebranch/templates/template-buildrp-buildaro.yml@self
11 changes: 11 additions & 0 deletions .pipelines/onebranch/templates/template-buildrp-buildaro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ steps:
targetType: inline
script: |
export GOPATH=$(Agent.TempDirectory)
export TAG=$(git describe --exact-match 2>/dev/null)
export COMMIT=$(git rev-parse --short=7 HEAD)$([[ $(git status --porcelain) = "" ]] || echo -dirty)
if [ -z "$TAG" ];
then
export VERSION=${COMMIT}
else
export VERSION=${TAG}
fi
echo "Version: ${VERSION}"
echo "##vso[task.setvariable variable=releasetag;isOutput=true]${VERSION}"
Copy link
Contributor

Choose a reason for hiding this comment

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

interesting trick to export this

mkdir -p $(Agent.TempDirectory)/src/github.com/Azure/
cp -rd $(Build.SourcesDirectory) $(Agent.TempDirectory)/src/github.com/Azure/ARO-RP
cd $(Agent.TempDirectory)/src/github.com/Azure/ARO-RP
make aro
mkdir -p $(ob_outputDirectory)
cp aro $(ob_outputDirectory)/aro
workingDirectory: $(Build.SourcesDirectory)
name: buildaro
- task: Bash@3
displayName: 🕵️ Validate FIPS
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ steps:
saveImageToPath: aro-rp.tar
buildkit: 1
enable_network: true
build_tag: $(Build.SourceBranchName)
build_tag: $(release_tag)