58 строки
1.8 KiB
YAML
58 строки
1.8 KiB
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
parameters:
|
|
- name: buildRepoRoot
|
|
type: string
|
|
default: "$(Build.SourcesDirectory)"
|
|
|
|
- name: outputArtifactsFolder
|
|
type: string
|
|
default: "$(Build.ArtifactStagingDirectory)"
|
|
|
|
- name: outputArtifactsLogsSubfolder
|
|
type: string
|
|
default: "LOGS"
|
|
|
|
- name: outputArtifactsPackagesSubfolder
|
|
type: string
|
|
default: "ARTIFACTS"
|
|
|
|
- name: selfRepoName
|
|
type: string
|
|
default: "CBL-Mariner"
|
|
|
|
steps:
|
|
- template: ToolkitCheck.yml@${{ parameters.selfRepoName }}
|
|
parameters:
|
|
buildRepoRoot: ${{ parameters.buildRepoRoot }}
|
|
|
|
- bash: sudo make -C "${{ parameters.buildRepoRoot }}/toolkit" "-j$(nproc)" toolchain QUICK_REBUILD=y
|
|
displayName: "Build toolchain"
|
|
|
|
- bash: |
|
|
failed_rpms_log="${{ parameters.buildRepoRoot }}/build/logs/toolchain/failures.txt"
|
|
|
|
if [[ -f "$failed_rpms_log" ]]; then
|
|
echo "List of RPMs that failed to build:" >&2
|
|
cat "$failed_rpms_log" >&2
|
|
else
|
|
echo "Build failed - no specific RPM" >&2
|
|
fi
|
|
condition: failed()
|
|
displayName: "Print failed RPMs"
|
|
|
|
- bash: |
|
|
published_artifacts_dir="${{ parameters.outputArtifactsFolder }}/${{ parameters.outputArtifactsPackagesSubfolder }}"
|
|
mkdir -p "$published_artifacts_dir"
|
|
cp "${{ parameters.buildRepoRoot }}"/build/toolchain/toolchain_built_{,s}rpms_*.tar.gz "$published_artifacts_dir"
|
|
displayName: "Copy artifacts for publishing"
|
|
|
|
- bash: |
|
|
published_logs_dir="${{ parameters.outputArtifactsFolder }}/${{ parameters.outputArtifactsLogsSubfolder }}"
|
|
mkdir -p "$published_logs_dir"
|
|
tar -C "${{ parameters.buildRepoRoot }}/build/logs/toolchain" -czf "$published_logs_dir/toolchain.logs.tar.gz" .
|
|
condition: always()
|
|
displayName: "Copy logs for publishing"
|
|
|