Skip to content

Use Separate Version for Build vs. Source #3751

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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
57 changes: 20 additions & 37 deletions .pipelines/build/ob-prepare.steps.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,5 @@

steps:
- template: utils/rename-dockerfile-references.steps.yaml
parameters:
topic: "Linux - ipv6-hp-bpf"
replace_references: true
source_path: bpf-prog/ipv6-hp-bpf
target_path: bpf-prog/ipv6-hp-bpf
source_dockerfile: linux.Dockerfile

# - template: utils/rename-dockerfile-references.steps.yaml
# parameters:
# topic: "Windows - npm"
# replace_references: true
# working_directory: $(ACN_DIR)
# source_path: npm
# target_path: npm-windows
# source_dockerfile: windows.Dockerfile

# - template: utils/rename-dockerfile-references.steps.yaml
# parameters:
# topic: "Linux - npm"
# replace_references: true
# working_directory: $(ACN_DIR)
# source_path: npm
# target_path: npm
# source_dockerfile: linux.Dockerfile

- bash: |
rm -rf .hooks .github
displayName: "Remove Unnecessary Dirs from Source"
workingDirectory: $(Build.SourcesDirectory)/azure-container-networking

- task: CopyFiles@2
displayName: "Add Repo to Container Artifacts"
inputs:
sourceFolder: $(Build.SourcesDirectory)/azure-container-networking
targetFolder: $(Build.ArtifactStagingDirectory)

- script: |
STORAGE_ID=$(echo "${BUILD_BUILDNUMBER//./-}")
echo "##vso[task.setvariable variable=StorageID;isOutput=true]$STORAGE_ID"
Expand Down Expand Up @@ -89,4 +52,24 @@ steps:
name: "EnvironmentalVariables"
displayName: "Set environmental variables"
condition: always()
# Use dev version of Makefile for development version
workingDirectory: $(ACN_DIR)

- bash: |
rm -rf .hooks .github .pipelines .git
displayName: "Remove Unnecessary Dirs from Source"
workingDirectory: $(ACN_DIR)

#- task: CopyFiles@2
# displayName: "Add Development Src to Container Artifacts"
# inputs:
# sourceFolder: $(ACN_DIR)
# targetFolder: $(OUT_DIR)


- task: CopyFiles@2
displayName: "Add Pipeline Orchestration to Container Artifacts"
inputs:
sourceFolder: $(ACN_DEVOPS_DIR)/.pipelines
targetFolder: $(ACN_DIR)/.pipelines
CleanTargetFolder: false
37 changes: 30 additions & 7 deletions .pipelines/run-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,46 @@ stages:
- stage: setup
displayName: ACN
variables:
ACN_DIR: azure-container-networking

ACN_DEVOPS_DIR: $(Build.SourcesDirectory)/azure-container-networking
jobs:
- job: copy
displayName: Copy Pipeline Files
pool:
type: linux
variables:
ob_outputDirectory: $(Build.ArtifactStagingDirectory)
ob_git_checkout: true
steps:
- checkout: acn-devops

- task: CopyFiles@2
displayName: "Add Pipeline Orchestration to Container Artifacts"
inputs:
sourceFolder: $(ACN_DEVOPS_DIR)/.pipelines
targetFolder: $(Build.ArtifactStagingDirectory)/.pipelines

- job: env
displayName: Setup
pool:
type: linux
dependsOn: copy
variables:
ob_outputDirectory: $(Build.ArtifactStagingDirectory)
ob_outputDirectory: $(Build.SourcesDirectory)/azure-container-networking
ob_artifactSuffix: _source
ob_git_checkout: true

ACR_DIR: $(Build.SourcesDirectory)/azure-container-networking
ACN_DIR: $(Build.SourcesDirectory)/azure-container-networking
ACN_DEVOPS_DIR: $(Agent.BuildDirectory)/drop_setup_copy
BUILD_TYPE: $(IMAGE_ACR_TYPE)
steps:
- checkout: azure-container-networking
- template: build/ob-prepare.steps.yaml
- download: current
artifact: drop_setup_copy

- template: build/ob-prepare.steps.yaml@acn-devops

- template: templates/run-unit-tests.stages.yaml
- template: templates/run-unit-tests.stages.yaml@acn-devops


- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}:
Expand All @@ -44,7 +67,7 @@ stages:
IPV6_HP_BPF_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.ipv6HpBpfVersion'] ]
NPM_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.npmVersion'] ]
jobs:
- template: /.pipelines/build/images.jobs.yaml
- template: /.pipelines/build/images.jobs.yaml@acn-devops
parameters:
images:
- job: linux_amd64
Expand Down Expand Up @@ -202,7 +225,7 @@ stages:
NPM_WINDOWS_AMD64_REF: $(IMAGE_REPO_PATH)/windows-amd64/npm:$(Build.BuildNumber)
jobs:

- template: build/manifests.jobs.yaml
- template: build/manifests.jobs.yaml@acn-devops
parameters:
generate:
- job: azure_ipam
Expand Down
Loading