Skip to content

Commit

Permalink
Enable bootstrap flow testing in CI (#15728)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Rummel <crummel@microsoft.com>
  • Loading branch information
mthalman and crummel authored Mar 8, 2023
1 parent d7858d7 commit 54801b2
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 15 deletions.
20 changes: 17 additions & 3 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ parameters:
type: boolean
default: false

- name: prepNoArtifacts
type: boolean
default: false

- name: prepNoSdk
type: boolean
default: false

jobs:
- job: ${{ parameters.buildName }}_${{ parameters.architecture }}
timeoutInMinutes: 150
Expand Down Expand Up @@ -150,9 +158,15 @@ jobs:
- script: |
set -x
if [[ -z '${{ parameters.reuseBuildArtifactsFrom }}' ]]; then
docker run --rm -v "$(sourcesPath):/vmr" -w /vmr ${{ parameters.container }} ./prep.sh
else
customPrepArgs=""
if [[ '${{ parameters.prepNoArtifacts }}' == 'True' ]]; then
customPrepArgs="${customPrepArgs} --no-artifacts"
fi
if [[ '${{ parameters.prepNoSdk }}' == 'True' ]]; then
customPrepArgs="${customPrepArgs} --no-sdk"
fi
docker run --rm -v "$(sourcesPath):/vmr" -w /vmr ${{ parameters.container }} ./prep.sh ${customPrepArgs}
if [[ '${{ parameters.prepNoSdk }}' == 'True' || -n '${{ parameters.reuseBuildArtifactsFrom }}' ]]; then
mkdir $(sourcesPath)/.dotnet
previousSdkPath="$(sourcesPath)/prereqs/packages/archive/dotnet-sdk-*.tar.gz"
eval tar -ozxf "$previousSdkPath" -C "$(sourcesPath)/.dotnet"
Expand Down
14 changes: 14 additions & 0 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ stages:
excludeSdkContentTests: true #
overrideDistroDisablingSha1: false # 🚫
runOnline: true #
prepNoArtifacts: false # 🚫
prepNoSdk: false # 🚫

- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: ../jobs/vmr-build.yml
Expand All @@ -99,6 +101,8 @@ stages:
excludeSdkContentTests: false # 🚫
overrideDistroDisablingSha1: false # 🚫
runOnline: false # 🚫
prepNoArtifacts: false # 🚫
prepNoSdk: false # 🚫

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -116,6 +120,8 @@ stages:
excludeSdkContentTests: false # 🚫
overrideDistroDisablingSha1: true #
runOnline: false # 🚫
prepNoArtifacts: false # 🚫
prepNoSdk: false # 🚫

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -133,6 +139,8 @@ stages:
excludeSdkContentTests: false # 🚫
overrideDistroDisablingSha1: false # 🚫
runOnline: false # 🚫
prepNoArtifacts: false # 🚫
prepNoSdk: false # 🚫

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -150,6 +158,8 @@ stages:
excludeSdkContentTests: false # 🚫
overrideDistroDisablingSha1: false # 🚫
runOnline: false # 🚫
prepNoArtifacts: false # 🚫
prepNoSdk: false # 🚫

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -165,6 +175,8 @@ stages:
excludeSdkContentTests: false # 🚫
overrideDistroDisablingSha1: false # 🚫
runOnline: false # 🚫
prepNoArtifacts: false # 🚫
prepNoSdk: false # 🚫

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -182,4 +194,6 @@ stages:
excludeSdkContentTests: true #
overrideDistroDisablingSha1: false # 🚫
runOnline: false # 🚫
prepNoArtifacts: true #
prepNoSdk: true #
reuseBuildArtifactsFrom: Fedora36_Offline
2 changes: 1 addition & 1 deletion src/SourceBuild/content/eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
necessary, and this property is removed from the file.
-->
<PrivateSourceBuiltArtifactsPackageVersion>0.1.0-8.0.100-5.centos.8-x64</PrivateSourceBuiltArtifactsPackageVersion>
<PrivateSourceBuiltPrebuiltsPackageVersion>0.1.0-8.0.100-8.centos.8-x64</PrivateSourceBuiltPrebuiltsPackageVersion>
<PrivateSourceBuiltPrebuiltsPackageVersion>0.1.0-8.0.100-11.centos.8-x64</PrivateSourceBuiltPrebuiltsPackageVersion>
</PropertyGroup>
</Project>
33 changes: 22 additions & 11 deletions src/SourceBuild/content/prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)"
usage() {
echo "usage: $0"
echo ""
echo " Prepares the environment to be built by downloading Private.SourceBuilt.Artifacts.*.tar.gz and"
echo " installing the version of dotnet referenced in global.json"
echo ""
echo " Prepares the environment to be built by downloading the required archive files. This includes"
echo " the previously source-built artifacts archive, prebuilts archive, and .NET SDK."
echo "options:"
echo " --no-artifacts Exclude the download of the previously source-built artifacts archive."
echo " --no-prebuilts Exclude the download of the prebuilts archive."
echo " --no-sdk Exclude the download of the .NET SDK."
}

buildBootstrap=false
downloadArtifacts=true
downloadPrebuilts=true
installDotnet=true

positional_args=()
while :; do
if [ $# -le 0 ]; then
Expand All @@ -24,6 +30,15 @@ while :; do
usage
exit 0
;;
--no-artifacts)
downloadArtifacts=false
;;
--no-prebuilts)
downloadPrebuilts=false
;;
--no-sdk)
installDotnet=false
;;
*)
positional_args+=("$1")
;;
Expand All @@ -32,10 +47,6 @@ while :; do
shift
done

downloadArtifacts=true
downloadPrebuilts=true
installDotnet=true

# Check to make sure curl exists to download the archive files
if ! command -v curl &> /dev/null
then
Expand All @@ -46,20 +57,20 @@ fi
# Check if Private.SourceBuilt artifacts archive exists
artifactsBaseFileName="Private.SourceBuilt.Artifacts"
packagesArchiveDir="$SCRIPT_ROOT/prereqs/packages/archive/"
if [ -f ${packagesArchiveDir}${artifactsBaseFileName}.*.tar.gz ]; then
if [[ "$downloadArtifacts" == "true" && -f ${packagesArchiveDir}${artifactsBaseFileName}.*.tar.gz ]]; then
echo " Private.SourceBuilt.Artifacts.*.tar.gz exists...it will not be downloaded"
downloadArtifacts=false
fi

# Check if Private.SourceBuilt prebuilts archive exists
prebuiltsBaseFileName="Private.SourceBuilt.Prebuilts"
if [ -f ${packagesArchiveDir}${prebuiltsBaseFileName}.*.tar.gz ]; then
if [[ "$downloadPrebuilts" == "true" && -f ${packagesArchiveDir}${prebuiltsBaseFileName}.*.tar.gz ]]; then
echo " Private.SourceBuilt.Prebuilts.*.tar.gz exists...it will not be downloaded"
downloadPrebuilts=false
fi

# Check if dotnet is installed
if [ -d $SCRIPT_ROOT/.dotnet ]; then
if [[ "$installDotnet" == "true" && -d $SCRIPT_ROOT/.dotnet ]]; then
echo " ./.dotnet SDK directory exists...it will not be installed"
installDotnet=false;
fi
Expand Down

0 comments on commit 54801b2

Please sign in to comment.