Skip to content

Commit

Permalink
feat: first release
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaticaq committed Jan 31, 2020
1 parent 58aa9ec commit a56ef6d
Show file tree
Hide file tree
Showing 18 changed files with 1,880 additions and 1,614 deletions.
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
node_modules
coverage
test
.*
*.md
6 changes: 0 additions & 6 deletions CHANGELOG.md

This file was deleted.

124 changes: 109 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# @eclass/semantic-release-custom-plugin

[![npm](https://img.shields.io/npm/v/@eclass/semantic-release-custom-plugin.svg)](https://www.npmjs.com/package/@eclass/semantic-release-custom-plugin)
[![build](https://img.shields.io/travis/eclass/semantic-release-custom-plugin.svg)](https://travis-ci.org/eclass/semantic-release-custom-plugin)
[![downloads](https://img.shields.io/npm/dt/@eclass/semantic-release-custom-plugin.svg)](https://www.npmjs.com/package/@eclass/semantic-release-custom-plugin)
[![dependencies](https://img.shields.io/david/eclass/semantic-release-custom-plugin.svg)](https://david-dm.org/eclass/semantic-release-custom-plugin)
[![devDependency Status](https://img.shields.io/david/dev/eclass/semantic-release-custom-plugin.svg)](https://david-dm.org/eclass/semantic-release-custom-plugin#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/github/eclass/semantic-release-custom-plugin/badge.svg?branch=master)](https://coveralls.io/github/eclass/semantic-release-custom-plugin?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/f84f0bcb39c9a5c5fb99/maintainability)](https://codeclimate.com/github/eclass/semantic-release-custom-plugin/maintainability)
# @eclass/semantic-release-docker

[![npm](https://img.shields.io/npm/v/@eclass/semantic-release-docker.svg)](https://www.npmjs.com/package/@eclass/semantic-release-docker)
[![build](https://img.shields.io/travis/eclass/semantic-release-docker.svg)](https://travis-ci.org/eclass/semantic-release-docker)
[![downloads](https://img.shields.io/npm/dt/@eclass/semantic-release-docker.svg)](https://www.npmjs.com/package/@eclass/semantic-release-docker)
[![dependencies](https://img.shields.io/david/eclass/semantic-release-docker.svg)](https://david-dm.org/eclass/semantic-release-docker)
[![devDependency Status](https://img.shields.io/david/dev/eclass/semantic-release-docker.svg)](https://david-dm.org/eclass/semantic-release-docker#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/github/eclass/semantic-release-docker/badge.svg?branch=master)](https://coveralls.io/github/eclass/semantic-release-docker?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/f84f0bcb39c9a5c5fb99/maintainability)](https://codeclimate.com/github/eclass/semantic-release-docker/maintainability)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

> [semantic-release](https://github.com/semantic-release/semantic-release) plugin to deploy app
| Step | Description |
|--------------------|---------------------------------------------------------------------------------------------|
| `verifyConditions` | Verify the presence of the `CUSTOM_ENV` environment variable. |
| `publish` | Deploy app. |
| `verifyConditions` | Verify the presence of the `CI_REGISTRY_USER`, or `DOCKER_REGISTRY_USER`, `DOCKER_REGISTRY_PASSWORD` or `CI_REGISTRY_PASSWORD`, `CI_REGISTRY` or `CI_REGISTRY`, and `CI_REGISTRY_IMAGE` environment variable. |
| `prepare` | Tag docker images. |
| `publish` | Push docker images. |

## Install

```bash
npm i -D @eclass/semantic-release-custom-plugin
npm i -D @eclass/semantic-release-docker
```

## Usage
Expand All @@ -33,7 +34,7 @@ The plugin can be configured in the [**semantic-release** configuration file](ht
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-custom-plugin"
"@eclass/semantic-release-docker"
]
}
```
Expand All @@ -44,18 +45,111 @@ The plugin can be configured in the [**semantic-release** configuration file](ht

| Variable | Description |
| -------------------- | ----------------------------------------------------------------- |
| `CUSTOM_ENV` | A custom env var |
| `CI_REGISTRY_USER` | username for docker in gitlab ci. Only required if push images to gitlab docker registry. |
| `CI_REGISTRY_PASSWORD` | password for docker in gitlab ci. Only required if push images to gitlab docker registry. |
| `CI_REGISTRY` | registry for docker in gitlab ci. Only required if push images to gitlab docker registry. |
| `CI_REGISTRY_IMAGE` | image name for docker in gitlab ci. Only required if push images to gitlab docker registry. |
| `DOCKER_REGISTRY_USER` | username for generic docker. |
| `DOCKER_REGISTRY_PASSWORD` | password for generic docker. |
| `DOCKER_REGISTRY` | registry for generic docker. Optional. Its posible set in config plgin |
| `AWS_ACCESS_KEY_ID` | aws access key for get docker credentials from ecr. Optional. Only use if push images to ecr |
| `AWS_SECRET_ACCESS_KEY` | aws secret key for get docker credentials from ecr. Optional. Only use if push images to ecr |
| `AWS_REGION` | aws region for get docker credentials from ecr. Optional. Only use if push images to ecr |

### Examples

In Gitlab CI
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-custom-plugin"
"@eclass/semantic-release-docker"
]
}
```

Push images to other docker registry
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
[
"@eclass/semantic-release-docker",
{
"registryUrl": "registry.example.com",
"imageName": "registry.example.com/myapp"
}
]
]
}
```

Push images to aws ecr
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
[
"@eclass/semantic-release-docker",
{
"ecr": true,
"imageName": "1111.dkr.ecr.us-east-1.amazonaws.com/myapp"
}
]
]
}
```

Push images with aditional tags
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
[
"@eclass/semantic-release-docker",
{
"ecr": true,
"imageName": "1111.dkr.ecr.us-east-1.amazonaws.com/myapp",
"additionalTags": [
"next",
"beta"
]
}
]
]
}
```

Push images to aditional registries
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
[
"@eclass/semantic-release-docker",
{
"ecr": true,
"imageName": "1111.dkr.ecr.us-east-1.amazonaws.com/myapp",
"additionalRepos": [
"registry.example.com"
]
}
]
]
}
```
Expand Down
Loading

0 comments on commit a56ef6d

Please sign in to comment.