|
14 | 14 | - [Configuration](#configuration) |
15 | 15 | - [Initialization Scripts](#initialization-scripts) |
16 | 16 | - [Persistence](#persistence) |
| 17 | + - [How to deploy OpenVox/Puppet code](#how-to-deploy-openvoxpuppet-code) |
| 18 | + - [✅ Preferred way to deploy your code](#-preferred-way-to-deploy-your-code) |
| 19 | + - [🔥 Not recommended way, but often used, pattern from the non-container world](#-not-recommended-way-but-often-used-pattern-from-the-non-container-world) |
17 | 20 | - [How to Release the container](#how-to-release-the-container) |
18 | 21 | - [How to contribute](#how-to-contribute) |
19 | 22 |
|
@@ -189,6 +192,53 @@ These scripts are executed on container startup, before the OpenVox Server proce |
189 | 192 |
|
190 | 193 | These issues have not occurred with Docker so far. |
191 | 194 |
|
| 195 | +## How to deploy OpenVox/Puppet code |
| 196 | + |
| 197 | +### ✅ Preferred way to deploy your code |
| 198 | + |
| 199 | +We recommend to use the [r10k](https://github.com/voxpupuli/container-r10k) container and use a shared volume to deploy your code to the OpenVox Server. |
| 200 | + |
| 201 | +Example usage: <https://github.com/voxpupuli/crafty/blob/main/openvox/r10k/README.md> |
| 202 | + |
| 203 | +The r10k container can be scheduled to run at regular intervals to keep your OpenVox Server up to date with the latest code changes. |
| 204 | +Or you use the [r10k-webhook](https://github.com/voxpupuli/container-r10k-webhook) container to trigger a deployment when a new commit is pushed to your repository. |
| 205 | + |
| 206 | +### 🔥 Not recommended way, but often used, pattern from the non-container world |
| 207 | + |
| 208 | +At the moment the container has r10k installed. |
| 209 | +You can use it to deploy your code from within the container. |
| 210 | + |
| 211 | +🚧 ___Please be informed that this might change, and we’re considering removing the r10k installation from the container in the future.___ |
| 212 | + |
| 213 | +Create a `r10k.yaml` file with the following content and mount it to the container at `/etc/puppetlabs/r10k/r10k.yaml`: |
| 214 | + |
| 215 | +```yaml |
| 216 | +--- |
| 217 | +pool_size: 8 |
| 218 | +deploy: |
| 219 | + generate_types: true |
| 220 | + exclude_spec: true |
| 221 | + incremental: true |
| 222 | + purge_levels: [ 'deployment', 'environment', 'puppetfile' ] |
| 223 | +cachedir: "/opt/puppetlabs/puppet/cache/r10k" |
| 224 | +sources: |
| 225 | + puppet: |
| 226 | + basedir: "/etc/puppetlabs/code/environments" |
| 227 | + remote: https://github.com/voxpupuli/controlrepo.git |
| 228 | +``` |
| 229 | + |
| 230 | +Run the main container with the following command, which mounts the `r10k.yaml` file to the container: |
| 231 | + |
| 232 | +```shell |
| 233 | +podman run -it --rm --name openvox -v ./r10k:/etc/puppetlabs/r10k:ro ghcr.io/openvoxproject/openvoxserver:latest |
| 234 | +```` |
| 235 | +
|
| 236 | +Then you can run the following command to deploy your code. |
| 237 | +
|
| 238 | +```shell |
| 239 | +podman exec openvox r10k deploy environment -mv |
| 240 | +``` |
| 241 | + |
192 | 242 | ## How to Release the container |
193 | 243 |
|
194 | 244 | [see here](RELEASE.md) |
|
0 commit comments