-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ahoy.yml
127 lines (105 loc) · 3.63 KB
/
.ahoy.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
ahoyapi: v2
commands:
build:
usage: Build or rebuild project.
cmd: |
ahoy title "Building project"
ahoy pre-flight
ahoy reset
ahoy up
ahoy install
ahoy provision
ahoy doctor
ahoy info
ahoy title "Build complete"
cli:
usage: Start a shell inside CLI container or run a command.
cmd: echo "Would start a shell inside CLI container or run a command."
doctor:
usage: Find problems with current project setup.
cmd: echo "Would find problems with current project setup."
info:
usage: Print information about this project.
cmd: echo "Would print project information"
install:
usage: Install project and all dependencies
cmd: echo "Would install project and all dependencies."
provision:
usage: Run site provision operations.
cmd: echo "Would run provision operations."
reset:
usage: "Remove containers, all build files."
cmd: |
ahoy confirm "All containers and build files will be removed. Proceed?" &&
echo "Would remove containers and all build files."
down:
usage: Stop Docker containers and remove container, images, volumes and networks.
cmd: echo "Would stop Docker containers and remove container, images, volumes and networks."
lint:
usage: Lint code.
cmd: echo "Would lint code"
logs:
usage: Show Docker logs.
cmd: echo "Would show Docker logs."
pull:
usage: Pull latest docker images.
cmd: echo "Would pull latest docker images."
start:
usage: Start existing Docker containers.
cmd: echo "Would start existing Docker containers."
stop:
usage: Stop running Docker containers.
cmd: echo "Would stop running Docker containers."
test-unit:
usage: Run unit tests.
cmd: echo "Would run unit tests."
test-bdd:
usage: Run BDD tests.
cmd: echo "Would run bdd tests."
up:
usage: Build and start Docker containers.
cmd: echo "Would build and start Docker containers."
# Utilities.
title:
cmd: printf "$(tput -Txterm setaf 4)[INFO] ${1}$(tput -Txterm sgr0)\n"
hide: true
pre-flight:
cmd: echo "Would run pre-flight checks."
hide: true
local:
usage: Custom local commands. See `ahoy local help`.
cmd: |
if [ -f .ahoy.local.yml ]; then
ahoy -f ".ahoy.local.yml" "$@"
else
echo ".ahoy.local.yml does not exist."
echo "Copy .ahoy.local.example.yml to .ahoy.local.yml and rerun this command.";
fi
# ----------------------------------------------------------------------------
# Utilities.
# ----------------------------------------------------------------------------
confirm:
cmd: |
if [ -z "$AHOY_CONFIRM_RESPONSE" ]; then
read -r -p ">> $1 [y/N] " AHOY_CONFIRM_RESPONSE
[ "$AHOY_CONFIRM_RESPONSE" = "y" ] || [ "$AHOY_CONFIRM_RESPONSE" = true ] || ( echo "The operation was canceled." && exit 1 )
else
echo ">> $1 [y/N] $AHOY_CONFIRM_RESPONSE" \
&& if [ "${AHOY_CONFIRM_WAIT_SKIP}" != "1" ]; then echo "Waiting for 3 seconds... Press Ctrl+C to cancel."; sleep 3; fi
fi
hide: true
# Override entrypoint to alter default behaviour of Ahoy.
entrypoint:
# Run all commands in Bash.
- bash
# Read the commands from the string.
- -c
# Exit the script if any statement returns a non-true return value.
- -e
# Read variables from .env file, respecting existing environment variable values.
- |
[ -f .env ] && [ -s .env ] && t=$(mktemp) && export -p > "$t" && set -a && . ./.env && if [ -f ./.env.local ];then . ./.env.local;fi && set +a && . "$t" && rm "$t" && unset t
bash -e -c "$0" "$@"
- '{{cmd}}'
- '{{name}}'