forked from govCMS/govcms8-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ahoy.yml
131 lines (106 loc) · 3.66 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
128
129
130
131
---
ahoyapi: v2
commands:
up:
usage: Build project.
cmd: docker-compose up -d "$@"; ahoy govcms-deploy
down:
usage: Delete project (CAUTION).
cmd: |
if [ "$1" == "y" ]; then
docker-compose down
else
ahoy confirm "Running this command will destroy your current site, database and build? Are you sure you didn't mean ahoy stop?" &&
# Run this if confirm returns true
docker-compose down ||
# Run this if confirm returns false
echo "OK, probably a wise choice..."
fi
build:
usage: Build project.
cmd: docker-compose up -d --build "$@"; ahoy govcms-deploy
cli:
usage: Start a shell inside TEST container.
cmd: docker-compose exec test bash
run:
usage: Run command inside TEST container.
cmd: docker-compose exec -T test bash -c "$@"
govcms-deploy:
usage: Runs deployment commands (config import, updb, cr, set up file_stage_proxy)
cmd: docker-compose exec -T cli govcms-deploy
drush:
usage: Run drush commands in TEST container.
cmd: docker-compose exec -T test drush "$@"
logs:
usage: Show Docker logs.
cmd: docker-compose logs "$@"
ps:
usage: List running Docker containers.
cmd: docker-compose ps
restart:
usage: Restart Docker containers.
cmd: docker-compose restart
stop:
usage: Stop Docker containers.
cmd: docker-compose stop "$@"
install:
usage: Install the profile.
cmd: docker-compose exec -T test drush si -y govcms "$@"; ahoy govcms-deploy
login:
usage: Login to a website.
cmd: docker-compose exec -T test drush uli "$@"
cex:
usage: Export site configuration to default location.
cmd: docker-compose exec -T test drush cex sync
cim:
usage: Import site configuration. Will perform partial configuration overrides if a parameter is provided.
cmd: |
if [ -f ./config/default/system.site.yml ]; then
configUuid="$(cat ./config/default/system.site.yml | grep uuid | tail -c +7 | head -c 36)"
docker-compose exec -T test drush config-set system.site uuid $configUuid
fi
# No support for config import for entire site install.
docker-compose exec -T test drush ev '\Drupal::entityManager()->getStorage("shortcut_set")->load("default")->delete();'
docker-compose exec -T test drush pm-uninstall shortcut
if [ "$#" -eq 0 ]
then
docker-compose exec -T test drush cim sync
else
docker-compose exec -T test drush cim "$@" --partial
fi
mysql-import:
usage: Pipe in a sql file. `ahoy mysql-import local.sql`
cmd: |
if [ -e "$@" ] ; then
docker-compose exec test bash -c 'drush sql-drop' &&
docker-compose exec -T test bash -c 'drush sql-cli' < "$@"
else echo "Provided sql file" "$@" "does not exist"
fi
mysql-dump:
usage: Dump data out into a file. `ahoy mysql-dump local.sql`
cmd: docker-compose exec test bash -c 'drush sql-dump --ordered-dump' > "$@"
lint:
usage: Lint code
cmd: docker-compose exec -T test lint-theme
test-behat:
usage: Run Behat tests.
cmd: docker-compose exec -T test behat "$@"
test-phpunit:
usage: Run PHPUnit tests.
cmd: docker-compose exec -T test phpunit "$@"
pull:
usage: Pull latest docker images.
cmd: docker image ls --format \"{{.Repository}}:{{.Tag}}\" | grep govcms8lagoon/ | grep -v none | xargs -n1 docker pull | cat
audit-site:
usage: Run site audit
cmd: docker-compose exec -T test drutiny profile:run ci @self "$@"
confirm:
cmd: |
read -r -p "$@ [y/N] " response
if [[ $response = y ]]
then
true
else
false
fi
hide: true