Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Commit 00ec0e1

Browse files
committed
Added code to execute pre/post provisioning scripts
1 parent 722e785 commit 00ec0e1

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

provision/provision.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
#!/bin/bash
2+
3+
function run_scripts() {
4+
local dir=$1
5+
local dir_path="/vagrant/provision/${dir}"
6+
7+
if [[ -d ${dir_path} && "$(find ${dir_path} -maxdepth 1 -type f -name '*.sh')" ]]; then
8+
echo "[Info] Running ${dir}-provisioning scripts in provision/${dir}"
9+
10+
find ${dir_path} -maxdepth 1 -type f -name '*.sh' | sort | while read FILENAME; do
11+
# /bin/bash "${FILENAME}"
12+
${FILENAME}
13+
done
14+
15+
echo "[Info] Finished running ${dir}-provisioning scripts."
16+
fi
17+
}
18+
19+
# Run the pre-provisioning scripts
20+
run_scripts pre
21+
222
# Run dashbrew provisioner
323
/vagrant/provision/main/dashbrew provision
24+
25+
# Run the post-provisioning scripts
26+
run_scripts post

0 commit comments

Comments
 (0)