Nicolas Massé 1 week ago
parent
commit
2dcec43f7c
  1. 23
      docs/DEVELOPERS_GUIDE.md

23
docs/DEVELOPERS_GUIDE.md

@ -429,25 +429,22 @@ For dependent cookbooks to be able to inject configuration into your cookbook, y
```Makefile ```Makefile
# Short comment about the purpose of this hook # Short comment about the purpose of this hook
# For instance: "this hook allows dependent cookbooks to inject SQL scripts # For instance: "this hook allows dependent cookbooks to inject SQL scripts and shell scripts to initialize
# and shell scripts to initialize the PostgreSQL database for their own needs". # the PostgreSQL database for their own needs".
# Define the target files that will be deployed to the target system when the # Define the target files that will be deployed to the target system when the hook is used by a dependent cookbook.
# hook is used by a dependent cookbook.
TARGET_POSTGRESQL_FILES = $(patsubst other/postgresql/%, $(TARGET_CHROOT)/etc/quadlets/postgresql/init.d/%, $(wildcard other/postgresql/*)) TARGET_POSTGRESQL_FILES = $(patsubst other/postgresql/%, $(TARGET_CHROOT)/etc/quadlets/postgresql/init.d/%, $(wildcard other/postgresql/*))
# Inject those files into the example file set (you can also use the "TARGET_FILES" # Inject those files into the example file set (you can also use the "TARGET_FILES" variable instead if you
# variable instead if you want those files to be part of the final package, # want those files to be part of the final package, but usually they are just examples for the dependent
# but usually they are just examples for the dependent cookbooks to use and thus # cookbooks to use and thus they are not part of the final package)
# they are not part of the final package)
TARGET_EXAMPLE_FILES += $(TARGET_POSTGRESQL_FILES) TARGET_EXAMPLE_FILES += $(TARGET_POSTGRESQL_FILES)
# Define the installation rules for the target files # Define the installation rules for the target files
# Here .sql files and .sh files are deployed with different permissions, but # Here .sql files and .sh files are deployed with different permissions, but you can adjust the rules as
# you can adjust the rules as needed for your use case. # needed for your use case. You can also create sub-directories in your hook directory (other/postgresql
# You can also create sub-directories in your hook directory (other/postgresql # in this example) if you have different kinds of hooks that need to be deployed to different locations
# in this example) if you have different kinds of hooks that need to be deployed # on the target system.
# to different locations on the target system.
$(TARGET_CHROOT)/etc/quadlets/postgresql/init.d/%.sql: other/postgresql/%.sql $(TARGET_CHROOT)/etc/quadlets/postgresql/init.d/%.sql: other/postgresql/%.sql
install -m 0600 -o 10004 -g 10000 $< $@ install -m 0600 -o 10004 -g 10000 $< $@
$(TARGET_CHROOT)/etc/quadlets/postgresql/init.d/%.sh: other/postgresql/%.sh $(TARGET_CHROOT)/etc/quadlets/postgresql/init.d/%.sh: other/postgresql/%.sh

Loading…
Cancel
Save