Skip to content

Commit

Permalink
post-import-db.d run hooks scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Mar 28, 2024
1 parent 262d8c4 commit 123c15a
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .ddev/addon-metadata/pimp-my-shell/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pimp-my-shell
repository: .
version: ""
install_date: "2024-03-26T19:27:47-03:00"
install_date: "2024-03-28T11:06:50-03:00"
project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell.sh
Expand All @@ -10,5 +10,8 @@ project_files:
- commands/web/gum
- homeadditions/.local/share/bash-completion/completions/ahoy
- homeadditions/.config/starship.toml
- pimp-my-shell/hooks/README.md
- pimp-my-shell/hooks/post-import-db.sh
- pimp-my-shell/hooks/post-import-db.d
global_files: []
removal_actions: []
3 changes: 3 additions & 0 deletions .ddev/config.pimp-my-shell.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#ddev-generated
hooks:
post-import-db:
- exec: /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.sh
webimage_extra_packages:
- bash-completion
- boxes
Expand Down
1 change: 1 addition & 0 deletions .ddev/pimp-my-shell/hooks/post-import-db.d/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#ddev-generated
9 changes: 9 additions & 0 deletions .ddev/pimp-my-shell/hooks/post-import-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
#ddev-generated
set -e -o pipefail

for f in /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.d/*; do
if [ -x $f ]; then
$f;
fi
done
3 changes: 3 additions & 0 deletions config.pimp-my-shell.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#ddev-generated
hooks:
post-import-db:
- exec: /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.sh
webimage_extra_packages:
- bash-completion
- boxes
Expand Down
3 changes: 3 additions & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ project_files:
- commands/web/gum
- homeadditions/.local/share/bash-completion/completions/ahoy
- homeadditions/.config/starship.toml
- pimp-my-shell/hooks/README.md
- pimp-my-shell/hooks/post-import-db.sh
- pimp-my-shell/hooks/post-import-db.d
6 changes: 6 additions & 0 deletions pimp-my-shell/hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- #ddev-generated -->
The idea for directory is to provide a way for another addons to register hook
scripts. This is very similar to adding it to config.yaml, only that this exists
so that this scripts can be called from within ddev itself. For now this makes
sense for post-import-db hooks were one might have a locally defined import
method and/or script.
1 change: 1 addition & 0 deletions pimp-my-shell/hooks/post-import-db.d/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#ddev-generated
9 changes: 9 additions & 0 deletions pimp-my-shell/hooks/post-import-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
#ddev-generated
set -e -o pipefail

for f in /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.d/*; do
if [ -x $f ]; then
$f;
fi
done

0 comments on commit 123c15a

Please sign in to comment.