Skip to content

Commit 3634dc1

Browse files
committed
Switch to a Taskfile instead of Makefile.
1 parent 130b411 commit 3634dc1

File tree

2 files changed

+45
-51
lines changed

2 files changed

+45
-51
lines changed

Makefile

Lines changed: 0 additions & 51 deletions
This file was deleted.

Taskfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
dirname=${PWD##*/} # Get the current dir name, without full path
6+
dirname=${dirname:-/} # to correct for the case where PWD is / (root)
7+
dirname=`echo $dirname | tr '[:upper:]' '[:lower:]'` # Convert the dirname to lowercase.
8+
9+
project=${dirname}
10+
appContainer="php-fpm"
11+
12+
function build {
13+
docker compose build
14+
}
15+
16+
function start {
17+
docker compose up -d
18+
}
19+
20+
function stop {
21+
docker compose down
22+
}
23+
24+
function restart {
25+
stop
26+
start
27+
}
28+
29+
function shell {
30+
start
31+
docker exec -it $(docker ps -q --filter="NAME=${project}-${appContainer}") bash
32+
}
33+
34+
function default {
35+
start
36+
}
37+
38+
function help {
39+
echo "$0 <task> <args>"
40+
echo "Tasks:"
41+
compgen -A function | cat -n
42+
}
43+
44+
TIMEFORMAT="Task completed in %3lR"
45+
time ${@:-default}

0 commit comments

Comments
 (0)