Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update container env #72

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The following parameters are available in the `hdm` class:
* [`method`](#-hdm--method)
* [`manage_docker`](#-hdm--manage_docker)
* [`version`](#-hdm--version)
* [`container_registry_url`](#-hdm--container_registry_url)
* [`ruby_version`](#-hdm--ruby_version)
* [`port`](#-hdm--port)
* [`bind_ip`](#-hdm--bind_ip)
Expand Down Expand Up @@ -96,6 +97,15 @@ Please find the releases on HDM website: https://github.com/betadots/hdm/release

Default value: `'1.0.1'`

##### <a name="-hdm--container_registry_url"></a>`container_registry_url`

Data type: `String[1]`

Configure another registry. Contains the host, path and container name. The version is set via the version parameter.
e.g. ghcr.io/betadots/hdm

Default value: `'ghcr.io/betadots/hdm'`

##### <a name="-hdm--ruby_version"></a>`ruby_version`

Data type: `String[1]`
Expand Down
6 changes: 4 additions & 2 deletions manifests/docker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@
ensure => file,
}

docker::image { 'ghcr.io/betadots/hdm':
docker::image { $hdm::container_registry_url:
image_tag => $hdm::version,
}

docker::run { 'hdm':
image => "ghcr.io/betadots/hdm:${hdm::version}",
image => "${hdm::container_registry_url}:${hdm::version}",
env => [
"TZ=${$hdm::timezone}",
"RAILS_DEVELOPMENT_HOSTS=${hdm::hostname}",
"SECRET_KEY_BASE=${hdm::secret_key_base}",
"HDM_PORT=${hdm::port}",
"HDM_HOST=${hdm::hostname}",
],
volumes => [
"${hdm::hdm_path}:${hdm::hdm_path}",
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# the git tag when using rvm
# Please find the releases on HDM website: https://github.com/betadots/hdm/releases
#
# @param container_registry_url Configure another registry. Contains the host, path and container name. The version is set via the version parameter.
# e.g. ghcr.io/betadots/hdm
#
# @param ruby_version Select the ruby version when installing using rvm
# Please check [hdm ruby version requirement](https://github.com/betadots/hdm/blob/main/.ruby-version)
#
Expand Down Expand Up @@ -122,6 +125,7 @@
# installation parameter
String[1] $version = '1.0.1',
Enum['docker', 'rvm'] $method = 'docker',
String[1] $container_registry_url = 'ghcr.io/betadots/hdm',
Boolean $manage_docker = true,
String[1] $ruby_version = '3.1.2',
# required application parameter
Expand Down