npm package: @iauditfrance/semantic-plugins
Description: bunch of custom plugins for semantic-release
Author: Nathan M
Latest version: 1.1.0

# semantic-release-plugins

![npm](https://img.shields.io/npm/v/@amille/semantic-release-plugins)
![CircleCI](https://img.shields.io/circleci/build/github/amille44420/semantic-release-plugins)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

Provide a bunch of custom plugins for `semantic-release`.

```sh
# install using npm
npm install --save-dev @amille/semantic-release-plugins

# or using yarn
yarn add -D @amille/semantic-release-plugins
```

## Build docker image

You may automatically build and push docker.

Add the plugin `@amille/semantic-release-plugins/dockerize` to your `.releaserc` file.


```json
{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@amille/semantic-release-plugins/dockerize"
    ]
}
```

And finally you may either configure it using environment variables

| Variable name   | Mandatory          | Description                           |
| --------------- | ------------------ | ------------------------------------- |
| DOCKER_REGISTRY |                    | Docker registry (ex: `hub.domain.co`) |
| DOCKER_IMAGE    | :heavy_check_mark: | Image name (ex: `hello-world`)        |
| DOCKER_LOGIN    |                    | Username for docker login             |
| DOCKER_PASSWORD |                    | Password for docker login             |
| DOCKER_FILE     |                    | Dockerfile                            |

Or configure it using plugin configuration.
The environment variable will be used as fallback.

```json
{
    "plugins": [
        [
            "@amille/semantic-release-plugins/dockerize",
            {
                "registry": "hub.domain.co",
                "image": "my-image",
                "dockerfile": "other.Dockerfile"
            }
        ]
    ]
}
```

You may use plugin settings to inject the version as `build arg`

```json
{
    "plugins": [
        [
            "@amille/semantic-release-plugins/dockerize",
            {
                "argVersion": "VERSION"
            }
        ]
    ]
}
```

## Update app version in helm chart

You may automatically update the `appVersion` in a helm chart file.

Add the plugin `@amille/semantic-release-plugins/updateHelmChart` to your `.releaserc` file.

```json
{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        [
            "@amille/semantic-release-plugins/updateHelmChart",
            {
                "chart": "./chart/Chart.yaml"
            }
        ]
    ]
}
```

## Create archive

You may automatically create archives.

Add the plugin `@amille/semantic-release-plugins/archive` to your `.releaserc` file.

```json
{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        [
            "@amille/semantic-release-plugins/archive",
            {
                "output": "./archive.zip",
                "assets": ["path/to/file", "glob/pattern/*.js", { "pattern": "path/dir", "relative": "path/" }],
                "globOptions": {}
            }
        ]
    ]
}
```

## Create sentry release

You may automatically create sentry releases (this plugins requires the cli client to be available).

Add the plugin `@amille/semantic-release-plugins/sentryRelease` to your `.releaserc` file.

```json
{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        [
            "@amille/semantic-release-plugins/sentryRelease",
            {
                "project": "my-project",
                "sourcemaps": ["build/"],
            }
        ]
    ]
}
```