Skip to content

Commit

Permalink
docs: move all documentation into Docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
fallion committed Jun 1, 2020
1 parent be72ced commit a9e097d
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 150 deletions.
72 changes: 1 addition & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,7 @@ Tool to make sure your commits are compliant with [conventional commits](https:/
## Table of contents

1. [Usage](#usage)
2. [Flags](#flags)

## Usage

Please check [Documentation](https://commitsar.tech).

**Important: Commitsar currently needs to be run in the same folder as the git repository you want checked, currently no override is provided for setting path to git repo see https://github.com/aevea/commitsar/issues/93**

#### Running using https://gobinaries.com/

```sh
curl -sf https://gobinaries.com/aevea/commitsar | sh
```

Or a specific version:
```sh
curl -sf https://gobinaries.com/aevea/commitsar[@VERSION] | sh
```


#### Github action

Checkout git in order to get commits and master branch

```
- name: Check out code into the Go module directory
uses: actions/checkout@v1
```

Run the Commitsar action

```
- name: Commitsar Action
uses: docker://aevea/commitsar
```

##### Example for CircleCI:

```
validate-commits:
docker:
- image: aevea/commitsar
steps:
- checkout
- run: commitsar
```

##### From binary

Adjust for version and distribution. Please check [Releases](https://github.com/aevea/commitsar/releases).

```
- curl -L -O https://github.com/aevea/commitsar/releases/download/v0.0.2/commitsar_v0.0.2_Linux_x86_64.tar.gz
- tar -xzf commitsar_v0.0.2_Linux_x86_64.tar.gz
- ./commitsar
```

# Flags

Commitsar allows the following flags:

| Name | Flag | Required | Default | Description |
| ------- | ----- | -------- | ------- | ---------------------------------------------------------------------------------- |
| Verbose | --v | false | false | Debug output into console |
| Strict | --s | false | true | Strict check of category types |
| All | --all | false | false | Whether to check all commits on given branch. **Takes precedence over LIMIT flag** |

On top of that a single argument is allowed:

`commitsar <from commit>...<to commit>`

e.g. `commitsar 7dbf3e7db93ae2e02902cae9d2f1de1b1e5c8c92...d0240d3ed34685d0a5329b185e120d3e8c205be4`

If only one commit hash is used then commitsar will assume it to be the TO commit.
Please check [Documentation](https://commitsar.tech).
8 changes: 0 additions & 8 deletions www/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,3 @@ $ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
20 changes: 20 additions & 0 deletions www/docs/configuration/flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id: flags
title: Flags
---

For more advanced usage a set of flags are provided.

| Name | Flag | Required | Default | Description |
| ------- | ----- | -------- | ------- | ---------------------------------------------------------------------------------- |
| Verbose | --v | false | false | Debug output into console |
| Strict | --s | false | true | Strict check of category types |
| All | --all | false | false | Whether to check all commits on given branch. **Takes precedence over LIMIT flag** |

On top of that a single argument is allowed:

`commitsar <from commit>...<to commit>`

e.g. `commitsar 7dbf3e7db93ae2e02902cae9d2f1de1b1e5c8c92...d0240d3ed34685d0a5329b185e120d3e8c205be4`

If only one commit hash is used then commitsar will assume it to be the TO commit.
56 changes: 1 addition & 55 deletions www/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,4 @@ Tool to make sure your commits are compliant with [conventional commits](https:/

Commitsar is shipped as a Dockerfile. This is the easiest way to add it to your CI.

**Important: Commitsar currently needs to be run in the same folder as the git repository you want checked, currently no override is provided for setting path to git repo see https://github.com/aevea/commitsar/issues/93**

#### Github action

> Github actions
Checkout git in order to get commits and master branch

```
- name: Check out code into the Go module directory
uses: actions/checkout@v1
```

Run the Commitsar action

```
- name: Commitsar Action
uses: aevea/commitsar@v0.6.3 (substitute for current version)
```

## Example for CircleCI

> CircleCI
```yaml
validate-commits:
docker:
- image: aevea/commitsar
steps:
- checkout
- run: commitsar
```

## Example for GitLab CI

> GitLab CI
```yaml
validate-commits:
image: aevea/commitsar
script:
- commitsar
```
## From binary
> Binary
```shell
- curl -L -O https://github.com/aevea/commitsar/releases/download/v0.0.2/commitsar_v0.0.2_Linux_x86_64.tar.gz
- tar -xzf commitsar_v0.0.2_Linux_x86_64.tar.gz
- ./commitsar
```
> **Important** adjust for current version
**Important: Commitsar currently needs to be run in the same folder as the git repository you want checked, currently no override is provided for setting path to git repo see https://github.com/aevea/commitsar/issues/93**
12 changes: 12 additions & 0 deletions www/docs/usage/binary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: binary
title: Binary
---

Adjust for version and distribution. Please check [Releases](https://github.com/aevea/commitsar/releases).

```
- curl -L -O https://github.com/aevea/commitsar/releases/download/v0.0.2/commitsar_v0.0.2_Linux_x86_64.tar.gz
- tar -xzf commitsar_v0.0.2_Linux_x86_64.tar.gz
- ./commitsar
```
13 changes: 13 additions & 0 deletions www/docs/usage/circleci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
id: circleci
title: CircleCI
---

```yaml
validate-commits:
docker:
- image: aevea/commitsar
steps:
- checkout
- run: commitsar
```
4 changes: 4 additions & 0 deletions www/docs/usage/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
id: docker
title: Docker
---
18 changes: 18 additions & 0 deletions www/docs/usage/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: github
title: Github Actions
---

Checkout git in order to get commits and master branch

```
- name: Check out code into the Go module directory
uses: actions/checkout@v1
```

Run the Commitsar action

```
- name: Commitsar Action
uses: aevea/commitsar@v0.6.3 (substitute for current version)
```
11 changes: 11 additions & 0 deletions www/docs/usage/gitlab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: gitlab
title: Gitlab CI
---

```yaml
validate-commits:
image: aevea/commitsar
script:
- commitsar
```
16 changes: 16 additions & 0 deletions www/docs/usage/gobinaries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: gobinaries
title: GoBinaries
---

Running using https://gobinaries.com/

```sh
curl -sf https://gobinaries.com/aevea/commitsar | sh
```

Or a specific version:
```sh
curl -sf https://gobinaries.com/aevea/commitsar[@VERSION] | sh
```

4 changes: 4 additions & 0 deletions www/docs/usage/source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
id: source
title: Building from source
---
4 changes: 2 additions & 2 deletions www/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ module.exports = {
homePageId: "intro",
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
editUrl: "https://github.com/aevea/commitsar/edit/master/www/docs",
editUrl: "https://github.com/aevea/commitsar/edit/master/www/",
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl: "https://github.com/aevea/commitsar/edit/master/www/blog/",
editUrl: "https://github.com/aevea/commitsar/edit/master/www/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
Expand Down
3 changes: 1 addition & 2 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"scripts": {
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
"swizzle": "docusaurus swizzle"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.56",
Expand Down
12 changes: 12 additions & 0 deletions www/sidebars.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
module.exports = {
someSidebar: {
Introduction: ["intro"],
"Usage": [
"usage/gobinaries",
"usage/docker",
"usage/github",
"usage/gitlab",
"usage/circleci",
"usage/binary",
"usage/source",
],
Configuration: [
"configuration/flags",
],
},
};
25 changes: 13 additions & 12 deletions www/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@ import styles from "./styles.module.css";

const features = [
{
title: <>Easy to Use</>,
imageUrl: "img/undraw_docusaurus_mountain.svg",
title: <>Purpose</>,
imageUrl: "img/conventional-commits.png",
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
Tool to make sure your commits are compliant with conventional commits.
</>
),
},
{
title: <>Focus on What Matters</>,
imageUrl: "img/undraw_docusaurus_tree.svg",
title: <>Language agnostic</>,
imageUrl: "img/undraw_docusaurus_mountain.svg",
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
We aim for ease of use across repositories that use different languages.
This means we ship a Docker image or a binary. For added security you
can compile from source code.
</>
),
},
{
title: <>Powered by React</>,
imageUrl: "img/undraw_docusaurus_react.svg",
title: <>Powered by Go</>,
imageUrl: "img/gopher.svg",
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
This project is powered by the Go language. It allows us to
cross-compile for many different environments and also ship a small
binary/Docker image that cuts down on bootstrapping and network time.
</>
),
},
Expand Down
Binary file added www/static/img/conventional-commits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions www/static/img/gopher.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit a9e097d

@vercel
Copy link

@vercel vercel bot commented on a9e097d Jun 1, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.