File tree Expand file tree Collapse file tree 3 files changed +415
-355
lines changed
Expand file tree Collapse file tree 3 files changed +415
-355
lines changed Original file line number Diff line number Diff line change 22
33name : ContosoDevExp
44
5+ # hooks:
6+ # preprovision:
7+ # shell: sh
8+ # continueOnError: false
9+ # interactive: true
10+ # run: |
11+ # #!/bin/bash
12+
13+ # set -e
14+ # defaultPlatform="github"
15+
16+ # # Add a if statement to check if the environment variable is set
17+ # if [ -z "${SOURCE_CONTROL_PLATFORM}" ]; then
18+ # echo "SOURCE_CONTROL_PLATFORM is not set. Setting it to '${defaultPlatform}' by default."
19+ # export SOURCE_CONTROL_PLATFORM="${SOURCE_CONTROL_PLATFORM:-${defaultPlatform}}"
20+ # else
21+ # echo "Existing SOURCE_CONTROL_PLATFORM is set to '${SOURCE_CONTROL_PLATFORM}'."
22+ # fi
23+ # ./setup.sh -e ${AZURE_ENV_NAME} -s ${SOURCE_CONTROL_PLATFORM}
24+
25+
526hooks :
627 preprovision :
7- shell : sh
28+ shell : pwsh
829 continueOnError : false
930 interactive : true
1031 run : |
11- #!/bin/bash
32+ $ErrorActionPreference = "Stop"
33+ $defaultPlatform = "github"
1234
13- set -e
14- defaultPlatform="github"
35+ # Check if the environment variable is set
36+ if ([string]::IsNullOrEmpty($env:SOURCE_CONTROL_PLATFORM)) {
37+ Write-Host "SOURCE_CONTROL_PLATFORM is not set. Setting it to '$defaultPlatform' by default."
38+ $env:SOURCE_CONTROL_PLATFORM = $defaultPlatform
39+ } else {
40+ Write-Host "Existing SOURCE_CONTROL_PLATFORM is set to '$($env:SOURCE_CONTROL_PLATFORM)'."
41+ }
1542
16- # Add a if statement to check if the environment variable is set
17- if [ -z "${SOURCE_CONTROL_PLATFORM}" ]; then
18- echo "SOURCE_CONTROL_PLATFORM is not set. Setting it to '${defaultPlatform}' by default."
19- export SOURCE_CONTROL_PLATFORM="${SOURCE_CONTROL_PLATFORM:-${defaultPlatform}}"
20- else
21- echo "Existing SOURCE_CONTROL_PLATFORM is set to '${SOURCE_CONTROL_PLATFORM}'."
22- fi
23- ./setup.sh -e ${AZURE_ENV_NAME} -s ${SOURCE_CONTROL_PLATFORM}
43+ .\setup.ps1 -e $env:AZURE_ENV_NAME -s $env:SOURCE_CONTROL_PLATFORM
You can’t perform that action at this time.
0 commit comments