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

CICD Docs (Github/Gitlab) #743

Merged
merged 9 commits into from
May 26, 2024
Merged

Conversation

Parsifal-M
Copy link
Contributor

Hey Team! 👋

This closes #405 and adds a separate CICD doc 😃

I moved the Github one (as-is) from the README and added what we use for Regal in Gitlab CICD (which works for us).

LMK in terms of wording or structure if its okay and if not I will update it 👍

Thanks!

Signed-off-by: Peter Macdonald <[email protected]>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks, Peter 😃 Just a few thoughts, but nothing blocking.

README.md Outdated
@@ -152,30 +152,9 @@ Documentation: https://docs.styra.com/regal/rules/style/prefer-snake-case
> will likely generate a lot of violations. You can do this by passing the `--disable-category style` flag to
> `regal lint`.

### GitHub Actions
### Using Regal in CI/CD Workflows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Using Regal in your build pipeline" sounds a little less techno-babbly, perhaps?

README.md Outdated
```

Please see [`setup-regal`](https://github.com/StyraInc/setup-regal) for more information.
Kindly refer to the [CICD](/docs/cicd.md) documentation for more information on how to integrate Regal into your CI/CD workflows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little more context here would be helpful. Perhaps something like:

To ensure Regal's rules are enforced consistently in your project or organization, we've made it easy to run Regal as part of your builds. See the docs on "Using Regal in your build pipeline" to learn more about how to set up Regal to lint your policies on every commit or pull request.

docs/cicd.md Outdated
- uses: actions/checkout@v4
- uses: StyraInc/setup-regal@v1
with:
# For production workflows, use a specific version, like v0.16.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's going to be outdated soon anyway, let's bump this to v0.22.0 while we're at it.

docs/cicd.md Outdated
regal_lint_policies:
stage: regal-lint
image:
# For production workflows, use a specific version, like v0.16.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, bump version.


## GitLab CICD

To use Regal in GitLab CI/CD, you could for example use the following stage in your `.gitlab-ci.yml`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably obvious to someone who uses GitLab, but the GH example above specifically mentions running Regal on PRs, while this sentence says nothing about when/how this is triggered. Could you add that? 🙂

Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👏

Signed-off-by: Peter Macdonald <[email protected]>
Signed-off-by: Peter Macdonald <[email protected]>
@Parsifal-M
Copy link
Contributor Author

Think it should be okay now 😅 the markdown linter is a fussy one 😆

@anderseknert anderseknert merged commit 7b60e7c into StyraInc:main May 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation page for CI integration
2 participants