Skip to content

Commit 1de75f5

Browse files
committed
remove symlinks and update scripts with paths relative to its own folder instead of cwd
1 parent 625866f commit 1de75f5

File tree

11 files changed

+52
-23
lines changed

11 files changed

+52
-23
lines changed

aca-host/app

Lines changed: 0 additions & 1 deletion
This file was deleted.

aca-host/azure.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,22 @@ hooks:
9797
preprovision:
9898
windows:
9999
shell: pwsh
100-
run: ./scripts/auth_init.ps1
100+
run: ../scripts/auth_init.ps1
101101
interactive: true
102102
continueOnError: false
103103
posix:
104104
shell: sh
105-
run: ./scripts/auth_init.sh
105+
run: ../scripts/auth_init.sh
106106
interactive: true
107107
continueOnError: false
108108
postprovision:
109109
windows:
110110
shell: pwsh
111-
run: ./scripts/auth_update.ps1;./scripts/prepdocs.ps1
111+
run: ../scripts/auth_update.ps1; ../scripts/prepdocs.ps1
112112
interactive: true
113113
continueOnError: false
114114
posix:
115115
shell: sh
116-
run: ./scripts/auth_update.sh;./scripts/prepdocs.sh
116+
run: ../scripts/auth_update.sh; ../scripts/prepdocs.sh
117117
interactive: true
118118
continueOnError: false

aca-host/data

Lines changed: 0 additions & 1 deletion
This file was deleted.

aca-host/scripts

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/adlsgen2setup.sh

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

3-
. ./scripts/loadenv.sh
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
49

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

1015
echo 'Running "adlsgen2setup.py"'
1116

12-
./.venv/bin/python ./scripts/adlsgen2setup.py './data/*' --data-access-control './scripts/sampleacls.json' --storage-account "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" -v
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

scripts/auth_init.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
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+
38
echo "Checking if authentication should be setup..."
49

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

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

1217
echo "AZURE_USE_AUTHENTICATION is set, proceeding with authentication setup..."
1318

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

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

scripts/auth_update.sh

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

3-
. ./scripts/load_azd_env.sh
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
48

59
if [ -z "$AZURE_USE_AUTHENTICATION" ]; then
610
exit 0
711
fi
812

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

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

scripts/load_python_env.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
#!/bin/sh
1+
#!/bin/sh
2+
3+
# Get the project root of the current script
4+
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5+
app_dir="$project_root/app"
26

37
echo 'Creating Python virtual environment "app/backend/.venv"...'
48
python3 -m venv .venv
59

610
echo 'Installing dependencies from "requirements.txt" into virtual environment (in quiet mode)...'
7-
.venv/bin/python -m pip --quiet --disable-pip-version-check install -r app/backend/requirements.txt
11+
.venv/bin/python -m pip --quiet --disable-pip-version-check install -r $app_dir/backend/requirements.txt

scripts/loadenv.sh

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

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

5-
. ./scripts/load_python_env.sh
7+
. $script_dir/load_azd_env.sh
8+
9+
. $script_dir/load_python_env.sh

scripts/manageacl.sh

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

3-
. ./scripts/loadenv.sh
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/loadenv.sh
48

59
echo "Running manageacl.py. Arguments to script: $@"
6-
./.venv/bin/python ./scripts/manageacl.py --search-service "$AZURE_SEARCH_SERVICE" --index "$AZURE_SEARCH_INDEX" $@
10+
./.venv/bin/python $script_dir/manageacl.py --search-service "$AZURE_SEARCH_SERVICE" --index "$AZURE_SEARCH_INDEX" $@

0 commit comments

Comments
 (0)