Skip to content

Commit 7e49c99

Browse files
committed
Revert "remove symlinks and update scripts with paths relative to its own folder instead of cwd"
This reverts commit 40287f2.
1 parent 4174fd3 commit 7e49c99

18 files changed

+39
-75
lines changed

containerapps/app

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../app

containerapps/azure.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,22 @@ hooks:
9898
preprovision:
9999
windows:
100100
shell: pwsh
101-
run: ../scripts/auth_init.ps1
101+
run: ./scripts/auth_init.ps1
102102
interactive: true
103103
continueOnError: false
104104
posix:
105105
shell: sh
106-
run: ../scripts/auth_init.sh
106+
run: ./scripts/auth_init.sh
107107
interactive: true
108108
continueOnError: false
109109
postprovision:
110110
windows:
111111
shell: pwsh
112-
run: ../scripts/auth_update.ps1; ../scripts/prepdocs.ps1
112+
run: ./scripts/auth_update.ps1;./scripts/prepdocs.ps1
113113
interactive: true
114114
continueOnError: false
115115
posix:
116116
shell: sh
117-
run: ../scripts/auth_update.sh; ../scripts/prepdocs.sh
117+
run: ./scripts/auth_update.sh;./scripts/prepdocs.sh
118118
interactive: true
119119
continueOnError: false

containerapps/data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../data

containerapps/scripts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts

scripts/adlsgen2setup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## Set the preference to stop on the first error
22
$ErrorActionPreference = "Stop"
33

4-
$projectRoot = Split-Path -Parent $PSScriptRoot
54
& $PSScriptRoot\loadenv.ps1
65

76
$venvPythonPath = "./.venv/scripts/python.exe"
@@ -16,4 +15,5 @@ if ([string]::IsNullOrEmpty($env:AZURE_ADLS_GEN2_STORAGE_ACCOUNT)) {
1615
}
1716

1817
Write-Host 'Running "adlsgen2setup.py"'
19-
Start-Process -FilePath $venvPythonPath -ArgumentList "$projectRoot/scripts/adlsgen2setup.py `"$projectRoot/data`" --data-access-control $projectRoot/scripts/sampleacls.json --storage-account $env:AZURE_ADLS_GEN2_STORAGE_ACCOUNT -v" -Wait -NoNewWindow
18+
$cwd = (Get-Location)
19+
Start-Process -FilePath $venvPythonPath -ArgumentList "./scripts/adlsgen2setup.py `"$cwd/data`" --data-access-control ./scripts/sampleacls.json --storage-account $env:AZURE_ADLS_GEN2_STORAGE_ACCOUNT -v" -Wait -NoNewWindow

scripts/adlsgen2setup.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#!/bin/sh
22

3-
# Get the project root of the current script
4-
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5-
script_dir="$project_root/scripts"
6-
data_dir="$project_root/data"
7-
8-
. $script_dir/loadenv.sh
3+
. ./scripts/loadenv.sh
94

105
if [ -n "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" ]; then
116
echo 'AZURE_ADLS_GEN2_STORAGE_ACCOUNT must be set to continue'
@@ -14,4 +9,4 @@ fi
149

1510
echo 'Running "adlsgen2setup.py"'
1611

17-
./.venv/bin/python $script_dir/adlsgen2setup.py "$data_dir/*" --data-access-control "$script_dir/sampleacls.json" --storage-account "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" -v
12+
./.venv/bin/python ./scripts/adlsgen2setup.py './data/*' --data-access-control './scripts/sampleacls.json' --storage-account "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" -v

scripts/auth_init.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
$projectRoot = Split-Path -Parent $PSScriptRoot
2-
. $projectRoot/scripts/load_azd_env.ps1
1+
. ./scripts/load_azd_env.ps1
32

43
if (-not $env:AZURE_USE_AUTHENTICATION) {
54
Exit 0
65
}
76

8-
. $projectRoot/scripts/load_python_env.ps1
7+
. ./scripts/load_python_env.ps1
98

109
$venvPythonPath = "./.venv/scripts/python.exe"
1110
if (Test-Path -Path "/usr") {
1211
# fallback to Linux venv path
1312
$venvPythonPath = "./.venv/bin/python"
1413
}
1514

16-
Start-Process -FilePath $venvPythonPath -ArgumentList "$projectRoot/scripts/auth_init.py" -Wait -NoNewWindow
15+
Start-Process -FilePath $venvPythonPath -ArgumentList "./scripts/auth_init.py" -Wait -NoNewWindow

scripts/auth_init.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/bin/sh
22

3-
# Get the project root of the current script
4-
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5-
script_dir="$project_root/scripts"
6-
data_dir="$project_root/data"
7-
83
echo "Checking if authentication should be setup..."
94

10-
. $script_dir/load_azd_env.sh
5+
. ./scripts/load_azd_env.sh
116

127
if [ -z "$AZURE_USE_AUTHENTICATION" ]; then
138
echo "AZURE_USE_AUTHENTICATION is not set, skipping authentication setup."
@@ -16,6 +11,6 @@ fi
1611

1712
echo "AZURE_USE_AUTHENTICATION is set, proceeding with authentication setup..."
1813

19-
. $script_dir/load_python_env.sh
14+
. ./scripts/load_python_env.sh
2015

21-
./.venv/bin/python $script_dir/auth_init.py
16+
./.venv/bin/python ./scripts/auth_init.py

scripts/auth_update.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
$projectRoot = Split-Path -Parent $PSScriptRoot
2-
. $projectRoot/scripts/load_azd_env.ps1
1+
. ./scripts/load_azd_env.ps1
32

43
if (-not $env:AZURE_USE_AUTHENTICATION) {
54
Exit 0
65
}
76

8-
. $projectRoot/scripts/load_python_env.ps1
7+
. ./scripts/load_python_env.ps1
98

109
$venvPythonPath = "./.venv/scripts/python.exe"
1110
if (Test-Path -Path "/usr") {
1211
# fallback to Linux venv path
1312
$venvPythonPath = "./.venv/bin/python"
1413
}
1514

16-
Start-Process -FilePath $venvPythonPath -ArgumentList "$projectRoot/scripts/auth_update.py" -Wait -NoNewWindow
15+
Start-Process -FilePath $venvPythonPath -ArgumentList "./scripts/auth_update.py" -Wait -NoNewWindow

scripts/auth_update.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#!/bin/sh
22

3-
# Get the project root of the current script
4-
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5-
script_dir="$project_root/scripts"
6-
7-
. $script_dir/load_azd_env.sh
3+
. ./scripts/load_azd_env.sh
84

95
if [ -z "$AZURE_USE_AUTHENTICATION" ]; then
106
exit 0
117
fi
128

13-
. $script_dir/load_python_env.sh
9+
. ./scripts/load_python_env.sh
1410

15-
./.venv/bin/python $script_dir/auth_update.py
11+
./.venv/bin/python ./scripts/auth_update.py

0 commit comments

Comments
 (0)