Skip to content

Commit

Permalink
Merge pull request #85 from losisin/docs/gitlab-example
Browse files Browse the repository at this point in the history
docs: GitLab example to fail-on-diff
  • Loading branch information
losisin authored Aug 30, 2024
2 parents c86bcc9 + 2cbc4c2 commit 9fa4123
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ This is a great tool for adding git hooks to your project. You can find it's doc
},
```

### CI/CD fail-on-diff

You can use this plugin in your CI/CD pipeline to ensure that the schema is always up-to-date. Here is an example for GitLab [#82](https://github.com/losisin/helm-values-schema-json/issues/82):

```yaml
schema-check:
script:
- cd path/to/helm/chart
- helm schema -output generated-schema.json
- CURRENT_SCHEMA=$(cat values.schema.json)
- GENERATED_SCHEMA=$(cat generated-schema.json)
- |
if [ "$CURRENT_SCHEMA" != "$GENERATED_SCHEMA" ]; then
echo "Schema must be re-generated! Run 'helm schema' in the helm-chart directory" 1>&2
exit 1
fi
```

## Usage

```bash
Expand Down

0 comments on commit 9fa4123

Please sign in to comment.