Skip to content

Commit

Permalink
Merge pull request #41 from tuxmea/custom_entry_point
Browse files Browse the repository at this point in the history
Add option to have custom entry points.
  • Loading branch information
tuxmea authored Jan 26, 2024
2 parents 791271c + d4abb49 commit f0f8628
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [New version schema](#new-version-schema)
* [Configuration](#configuration)
+ [Cert File Locations](#cert-file-locations)
* [Initialization Scripts](#initialization-scripts)
* [How to Release the container](#how-to-release-the-container)
* [How to contribute](#how-to-contribute)

Expand Down Expand Up @@ -87,6 +88,11 @@ The directory structure follows the following conventions. The full path is alw
- 'ssl-key'
`/opt/puppetlabs/server/data/puppetdb/certs/private_keys/<certname>.pem`

## Initialization Scripts

If you would like to do additional initialization, add a directory called `/docker-custom-entrypoint.d/` and fill it with `.sh` scripts.
These scripts will be executed at the end of the entrypoint script, before the service is ran.

## How to Release the container

[see here](https://github.com/voxpupuli/crafty/blob/main/docs/how-to-release.md)
Expand Down
8 changes: 8 additions & 0 deletions puppetdb/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ for f in /docker-entrypoint.d/*.sh; do
"$f"
done

if [ -d /docker-custom-entrypoint.d/ ]; then
find /docker-custom-entrypoint.d/ -type f -name "*.sh" \
-exec chmod +x {} \;
sync
find /docker-custom-entrypoint.d/ -type f -name "*.sh" \
-exec echo Running {} \; -exec {} \;
fi

exec /opt/puppetlabs/bin/puppetdb "$@"

0 comments on commit f0f8628

Please sign in to comment.