generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrun
executable file
·58 lines (48 loc) · 1.07 KB
/
run
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
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Inspired on https://github.com/adriancooney/Taskfile
#
# Install an alias, to be able to simply execute `run`
# echo 'alias run=./scripts/run' >> ~/.aliases
#
# Define Docker Compose command prefix...
set -e
function help {
echo "$0 <task> <args>"
echo "Tasks:"
compgen -A function | cat -n
}
function default {
help
}
function prepare:repo {
rm -rf wrapper-mingle/vendor
cd wrapper-mingle
docker run --rm \
-v $PWD:/app \
-v $PWD:/app/packages/mingle \
-w /app \
composer install --ignore-platform-reqs --no-scripts
cd -
}
function setIDS {
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
}
function prepare:container {
setIDS
docker compose build
}
function dev:server {
setIDS
docker compose up --remove-orphans --force-recreate
}
function ci:server {
setIDS
docker compose up -d --remove-orphans --force-recreate
}
function dev:npm {
setIDS
docker compose exec webapp bash -c "npm ci ; npm run dev"
}
TIMEFORMAT="Task completed in %3lR"
time "${@:-default}"