-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[devops] Move bash script from yaml to it's own bash file. (#15861)
This makes it easier to both read & write bash code (syntax highlighting in the script file, shellscript to validate, etc.), as well as testing out the script locally.
- Loading branch information
1 parent
4cc0bde
commit ea60486
Showing
2 changed files
with
53 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash -eux | ||
|
||
set -o pipefail | ||
IFS=$'\n\t ' | ||
|
||
env | sort | ||
|
||
make global.json | ||
make -C builds dotnet | ||
|
||
var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=DOTNET) | ||
DOTNET=${var#*=} | ||
echo "Using dotnet found at $DOTNET" | ||
|
||
var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=DOTNET_PLATFORMS) | ||
DOTNET_PLATFORMS=${var#*=} | ||
echo "Dotnet platforms are '$DOTNET_PLATFORMS'" | ||
|
||
var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-abspath-variable VARIABLE=DOTNET_NUPKG_DIR) | ||
DOTNET_NUPKG_DIR=${var#*=} | ||
echo "Using nuget dir $DOTNET_NUPKG_DIR" | ||
|
||
ROLLBACK_PATH="$BUILD_SOURCESDIRECTORY/artifacts/WorkloadRollback/WorkloadRollback.json" | ||
|
||
echo "Rollback file contents:" | ||
cat "$ROLLBACK_PATH" | ||
|
||
mkdir -p "$DOTNET_NUPKG_DIR" | ||
ls -R "$BUILD_SOURCESDIRECTORY/artifacts/not-signed-package" | ||
cp "$BUILD_SOURCESDIRECTORY/artifacts/not-signed-package/"*.nupkg "$DOTNET_NUPKG_DIR" | ||
cp "$BUILD_SOURCESDIRECTORY/artifacts/not-signed-package/"*.pkg "$DOTNET_NUPKG_DIR" | ||
ls -R "$DOTNET_NUPKG_DIR" | ||
|
||
NUGET_SOURCES=$(grep https://pkgs.dev.azure.com ./NuGet.config | sed -e 's/.*value="//' -e 's/".*//') | ||
SOURCES=() | ||
for source in $NUGET_SOURCES; do | ||
SOURCES+=(--source) | ||
SOURCES+=("$source") | ||
done | ||
|
||
PLATFORMS=() | ||
for platform in $DOTNET_PLATFORMS; do | ||
CURRENT=$(echo "$platform" | tr "[:upper:]" "[:lower:]") | ||
PLATFORMS+=("$CURRENT") | ||
done | ||
|
||
$DOTNET workload install --from-rollback-file "$ROLLBACK_PATH" --source "$DOTNET_NUPKG_DIR" "${SOURCES[@]}" --verbosity diag "${PLATFORMS[@]}" | ||
|
||
var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=DOTNET_DIR) | ||
DOTNET_DIR=${var#*=} | ||
ls -lR "$DOTNET_DIR" |
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 comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.