mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
Update directory structure & allow to configure paths (tmp, log, cache)
This commit is contained in:
31
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/shell/execute-files.sh
vendored
Normal file
31
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/shell/execute-files.sh
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
echo "EXECUTIN EXECUTE-FILES.SH"
|
||||
|
||||
VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
|
||||
|
||||
EXEC_ONCE_DIR="$1"
|
||||
EXEC_ALWAYS_DIR="$2"
|
||||
|
||||
shopt -s nullglob
|
||||
files=("${VAGRANT_CORE_FOLDER}"/files/"${EXEC_ONCE_DIR}"/*)
|
||||
|
||||
if [[ (${#files[@]} -gt 0) ]]; then
|
||||
echo "Running files in files/${EXEC_ONCE_DIR}"
|
||||
|
||||
if [ ! -d "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" ]; then
|
||||
mkdir "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran"
|
||||
echo "Created directory /.puphpet-stuff/${EXEC_ONCE_DIR}-ran"
|
||||
fi
|
||||
|
||||
find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ONCE_DIR}" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec cp -n '{}' "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" \;
|
||||
find "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" -maxdepth 1 -type f -exec chmod +x '{}' \; -exec {} \; -exec sh -c '>{}' \;
|
||||
echo "Finished running files in files/${EXEC_ONCE_DIR}"
|
||||
echo "To run again, delete file(s) you want rerun in /.puphpet-stuff/${EXEC_ONCE_DIR}-ran or the whole folder to rerun all"
|
||||
fi
|
||||
|
||||
echo "Running files in files/${EXEC_ALWAYS_DIR}"
|
||||
find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ALWAYS_DIR}" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \;
|
||||
echo "Finished running files in files/${EXEC_ALWAYS_DIR}"
|
Reference in New Issue
Block a user