|
| 1 | +# Releasing |
| 2 | + |
| 3 | +This document describes the release process for the `peelman-kea` Puppet module. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Releases are automated via GitHub Actions. When a version tag (e.g., `v0.1.0`) is pushed, |
| 8 | +the CI pipeline runs all tests and, if successful, publishes the module to the |
| 9 | +[Puppet Forge](https://forge.puppet.com/modules/peelman/kea). |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +### GitHub Secrets |
| 14 | + |
| 15 | +The following secrets must be configured in the repository settings |
| 16 | +(Settings → Secrets and variables → Actions): |
| 17 | + |
| 18 | +| Secret | Description | |
| 19 | +|--------|-------------| |
| 20 | +| `FORGE_API_KEY` | Puppet Forge API key (generate at https://forge.puppet.com → Profile → API Keys) | |
| 21 | + |
| 22 | +## Release Process |
| 23 | + |
| 24 | +### 1. Bump the Version |
| 25 | + |
| 26 | +Use the provided rake tasks to bump the version in `metadata.json`: |
| 27 | + |
| 28 | +```bash |
| 29 | +# Patch release (0.0.4 → 0.0.5) |
| 30 | +bundle exec rake module:bump:patch |
| 31 | + |
| 32 | +# Minor release (0.0.4 → 0.1.0) |
| 33 | +bundle exec rake module:bump:minor |
| 34 | + |
| 35 | +# Major release (0.0.4 → 1.0.0) |
| 36 | +bundle exec rake module:bump:major |
| 37 | +``` |
| 38 | + |
| 39 | +### 2. Update CHANGELOG.md |
| 40 | + |
| 41 | +Add a new section for the release version: |
| 42 | + |
| 43 | +```markdown |
| 44 | +## [0.1.0] - YYYY-MM-DD |
| 45 | + |
| 46 | +### Added |
| 47 | +- New feature description |
| 48 | + |
| 49 | +### Changed |
| 50 | +- Changed behavior description |
| 51 | + |
| 52 | +### Fixed |
| 53 | +- Bug fix description |
| 54 | +``` |
| 55 | + |
| 56 | +### 3. Commit and Tag |
| 57 | + |
| 58 | +```bash |
| 59 | +git add metadata.json CHANGELOG.md |
| 60 | +git commit -m "Release v0.1.0" |
| 61 | +git push |
| 62 | + |
| 63 | +git tag v0.1.0 |
| 64 | +git push origin v0.1.0 |
| 65 | +``` |
| 66 | + |
| 67 | +### 4. Monitor CI |
| 68 | + |
| 69 | +The tag push triggers the CI pipeline: |
| 70 | + |
| 71 | +1. **Lint** - Puppet-lint and metadata validation |
| 72 | +2. **Syntax** - Puppet syntax validation |
| 73 | +3. **Unit Tests** - RSpec tests with Puppet 8 |
| 74 | +4. **Acceptance Tests** - Beaker tests on Debian 11/12, Ubuntu 22.04/24.04 |
| 75 | +5. **Release** - Build and publish to Puppet Forge (only on tags) |
| 76 | + |
| 77 | +Monitor progress at: https://github.com/peelman/puppet-kea/actions |
| 78 | + |
| 79 | +### 5. Verify Release |
| 80 | + |
| 81 | +After CI completes successfully, verify the release at: |
| 82 | +https://forge.puppet.com/modules/peelman/kea |
| 83 | + |
| 84 | +## CI Pipeline |
| 85 | + |
| 86 | +### Workflow File |
| 87 | + |
| 88 | +The CI configuration is in `.github/workflows/ci.yml`. |
| 89 | + |
| 90 | +### Triggers |
| 91 | + |
| 92 | +| Event | Behavior | |
| 93 | +|-------|----------| |
| 94 | +| Push to `main` | Runs lint, syntax, unit, and acceptance tests | |
| 95 | +| Pull request to `main` | Runs lint, syntax, unit, and acceptance tests | |
| 96 | +| Push tag `v*` | Runs all tests, then publishes to Forge | |
| 97 | + |
| 98 | +### Test Matrix |
| 99 | + |
| 100 | +| Job | Environment | |
| 101 | +|-----|-------------| |
| 102 | +| Lint | Ubuntu latest, Ruby 3.2 | |
| 103 | +| Syntax | Ubuntu latest, Ruby 3.2, Puppet 8 | |
| 104 | +| Unit | Ubuntu latest, Ruby 3.2, Puppet 8 | |
| 105 | +| Acceptance | Docker containers: Debian 11/12, Ubuntu 22.04/24.04 | |
| 106 | + |
| 107 | +### Acceptance Test Containers |
| 108 | + |
| 109 | +Acceptance tests use [litmusimage](https://hub.docker.com/u/litmusimage) containers |
| 110 | +which have SSH and systemd pre-configured for faster test execution. |
| 111 | + |
| 112 | +## Versioning |
| 113 | + |
| 114 | +This project follows [Semantic Versioning](https://semver.org/): |
| 115 | + |
| 116 | +- **MAJOR** - Incompatible API changes |
| 117 | +- **MINOR** - New functionality (backwards compatible) |
| 118 | +- **PATCH** - Bug fixes (backwards compatible) |
| 119 | + |
| 120 | +## Troubleshooting |
| 121 | + |
| 122 | +### Release job fails with 401 Unauthorized |
| 123 | + |
| 124 | +- Verify `FORGE_API_KEY` secret is set correctly |
| 125 | +- Ensure the API key hasn't expired (regenerate at Forge profile page) |
| 126 | +- The environment variable must be `BLACKSMITH_FORGE_API_KEY` in the workflow |
| 127 | + |
| 128 | +### Release job fails with 409 Conflict |
| 129 | + |
| 130 | +- The version already exists on the Forge |
| 131 | +- Deleted versions cannot be re-uploaded |
| 132 | +- Bump to a new version number and try again |
| 133 | + |
| 134 | +### Acceptance tests timeout |
| 135 | + |
| 136 | +- Check Docker is available in the CI runner |
| 137 | +- Verify the litmusimage containers are accessible |
| 138 | +- Review Beaker logs in the CI output |
| 139 | + |
| 140 | +## Local Testing |
| 141 | + |
| 142 | +Before pushing a release, run the full test suite locally: |
| 143 | + |
| 144 | +```bash |
| 145 | +# Install dependencies |
| 146 | +bundle install |
| 147 | + |
| 148 | +# Run linting |
| 149 | +bundle exec rake lint |
| 150 | + |
| 151 | +# Run unit tests |
| 152 | +bundle exec rake spec |
| 153 | + |
| 154 | +# Run acceptance tests (requires Docker) |
| 155 | +bundle exec rake beaker:debian12 |
| 156 | +``` |
| 157 | + |
| 158 | +## Tools |
| 159 | + |
| 160 | +This module uses [puppet-blacksmith](https://github.com/voxpupuli/puppet-blacksmith) |
| 161 | +for version management and Forge publishing. |
| 162 | + |
| 163 | +Available rake tasks: |
| 164 | + |
| 165 | +```bash |
| 166 | +bundle exec rake -T | grep module |
| 167 | +``` |
| 168 | + |
| 169 | +Key tasks: |
| 170 | +- `module:bump:patch` - Bump patch version |
| 171 | +- `module:bump:minor` - Bump minor version |
| 172 | +- `module:bump:major` - Bump major version |
| 173 | +- `module:build` - Build the module tarball |
| 174 | +- `module:push` - Push to Puppet Forge |
| 175 | +- `module:release` - Full release (bump, tag, push) |
0 commit comments