-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-add missing sources build stage for Azure Pipelines package build (#…
…407)
- Loading branch information
1 parent
fe8a059
commit bbea3aa
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Source build stage definition | ||
# Parameters: | ||
# - (Required) containerPath [string]: the full path to the container to be used for the build environmentr (Example. osconfig.azurecr.io/ubuntu20.04-dev-amd64:latest) | ||
# - (Optional) prefix [string]: the prefix for the stage/job to be used - default: source | ||
# - (Optional) publishArtifact [boolean]: publishes the built artifacts (packages) as pipeline artifacts - default: true | ||
|
||
parameters: | ||
- name: prefix | ||
type: string | ||
default: source | ||
|
||
- name: containerPath | ||
type: string | ||
|
||
- name: publishArtifact | ||
type: boolean | ||
default: false | ||
|
||
stages: | ||
- stage: source_build | ||
displayName: Source | ||
dependsOn: [] | ||
|
||
jobs: | ||
- job: ${{ parameters.prefix }} | ||
|
||
pool: | ||
vmImage: 'ubuntu-20.04' | ||
|
||
steps: | ||
|
||
- checkout: self | ||
submodules: recursive | ||
clean: true | ||
|
||
- task: Docker@2 | ||
displayName: Login to ACR | ||
inputs: | ||
command: login | ||
containerRegistry: $(SERVICE_CONNECTION) | ||
|
||
- script: | | ||
CONTAINER_ID=`docker run -di -v $(Build.SourcesDirectory):/AzOsConfig ${{ parameters.containerPath }}` | ||
echo CONTAINER_ID=$CONTAINER_ID | ||
echo "##vso[task.setvariable variable=CONTAINER_ID]$CONTAINER_ID" | ||
# Extract TWEAK version from full version string | ||
BUILD_VERSION_ARRAY=(`echo $(Build.BuildNumber) | tr '.' ' '`) | ||
TWEAK_VERSION=${BUILD_VERSION_ARRAY[-1]} | ||
echo TWEAK_VERSION=$TWEAK_VERSION | ||
echo "##vso[task.setvariable variable=TWEAK_VERSION]$TWEAK_VERSION" | ||
displayName: Container Setup | ||
- script: | | ||
docker exec $(CONTAINER_ID) bash -c "cmake -DCMAKE_BUILD_TYPE=Release -Duse_prov_client=ON -Dhsm_type_symm_key=ON -DCOMPILE_WITH_STRICTNESS=ON -DMAJOR_VERSION=$(MAJORVERSION) -DMINOR_VERSION=$(MINORVERSION) -DPATCH_VERSION=$(PATCHVERSION) -DTWEAK_VERSION=$(TWEAK_VERSION) -G Ninja -B/AzOsConfig/build -H/AzOsConfig/src" | ||
displayName: Generate build | ||
- script: | | ||
docker exec $(CONTAINER_ID) bash -c "cd /AzOsConfig/build && cmake --build . && cmake --build . --target dist && mkdir staging && cp -r /AzOsConfig/build/dist/* staging" | ||
displayName: Build & Stage Source Package | ||
- publish: $(Build.SourcesDirectory)/build/staging | ||
displayName: Publishing source package | ||
artifact: OSConfig_$(Build.BuildNumber)_SOURCES | ||
condition: eq(${{ parameters.publishArtifact }}, true) |