Skip to content

Commit

Permalink
Better documentation for CI (#572)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Poignant <[email protected]>
  • Loading branch information
thomaspoignant authored Mar 19, 2023
1 parent 229696f commit 759eb05
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion website/docs/linter.md → website/docs/linter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
sidebar_position: 91
description: Lint your config
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import styles from '../blog/2023-02-20-lint-your-feature-flags/styles.module.css';

# Lint your config

Expand Down Expand Up @@ -46,11 +49,24 @@ The command line has 2 arguments you should specify.
| `--input-file` | **(mandatory)** The location of your configuration file. |
| `--input-format` | **(mandatory)** The format of your current configuration file. <br/>Available formats are `yaml`, `json`, `toml`. |

## GitHub Actions
## Use the linter in your CI (continuous integration)



You can run `go-feature-flag-lint` using GitHub actions:

<Tabs groupId="code">
<TabItem value="githubaction" label="Github Action" attributes={{className: styles.github}}>

```yaml
name: "Build"
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -60,3 +76,40 @@ jobs:
with:
args: --input-file=/github/workspace/path/to/your/config.yaml --input-format=yaml
```
</TabItem>
<TabItem value="circleci" label="CircleCi" attributes={{className: styles.circleci}}>
```yaml
version: 2.1
jobs:
build:
docker:
- image: cimg/base:2022.05

steps:
- checkout
- run: curl -L $(curl -s https://api.github.com/repos/thomaspoignant/go-feature-flag/releases/latest | jq -r '.assets[] | select(.name|match("Linux_x86_64.tar.gz$")) | .browser_download_url' | grep 'go-feature-flag-lint') --output release.tar.gz && tar -zxvf release.tar.gz
- run: ./go-feature-flag-lint --input-format=yaml --input-file=flag-config.yaml # please put the right file name
```
</TabItem>
<TabItem value="gitlab" label="Gitlab" attributes={{className: styles.gitlab}}>
```yaml
image: ubuntu
lint-job:
stage: build

before_script:
- apt-get -qq update
- apt-get install -y jq curl

script:
- curl -L $(curl -s https://api.github.com/repos/thomaspoignant/go-feature-flag/releases/latest | jq -r '.assets[] | select(.name|match("Linux_x86_64.tar.gz$")) | .browser_download_url' | grep 'go-feature-flag-lint') --output release.tar.gz && tar -zxvf release.tar.gz
- ./go-feature-flag-lint --input-format=yaml --input-file=flag-config.yaml # please put the right file name
```
</TabItem>
</Tabs>

0 comments on commit 759eb05

Please sign in to comment.