-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall-provisioning.sh
executable file
·48 lines (35 loc) · 1.23 KB
/
install-provisioning.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
provisioning_dir="${PWD}"
source_dir="${provisioning_dir}/source"
(
set -o errexit
set -o pipefail
set -o nounset
echo "Installing local provisioning..."
if [ ! -f "${provisioning_dir}/.env" ]
then
cp -p "${provisioning_dir}/.env.dist" "${provisioning_dir}/.env"
fi
if [ ! -f "${source_dir}/.env" ]
then
cp -p "${source_dir}/.env.dist" "${source_dir}/.env"
fi
echo "Please, check variables in the .env files (both the one in the provisioning root, and the one in the source root)."
read -n 1 -s -r -p "Press any key to continue when you are sure every variable is correct."
echo ""
echo "Building vendor directory..."
docker run --rm --interactive --tty \
--volume ${PWD}/source:/app \
--user $(id -u):$(id -g) \
composer:latest install
echo "Building node modules..."
docker run --rm --interactive --tty \
--workdir /app \
--volume ${PWD}/source:/app \
--user $(id -u):$(id -g) \
node:lts-slim /bin/sh -c "npm install; npm run dev"
echo "Migrations..."
docker compose run standup_companion_local_service php artisan migrate
echo "Local provisioning successfully installed!"
echo "You can now run 'docker compose up -d' to start local services."
)