https://github.com/lgaticaq/semantic-release-rancher
Set of semantic-release plugins for upgrade service in rancher
https://github.com/lgaticaq/semantic-release-rancher
rancher semantic-release semantic-release-plugin
Last synced: 4 months ago
JSON representation
Set of semantic-release plugins for upgrade service in rancher
- Host: GitHub
- URL: https://github.com/lgaticaq/semantic-release-rancher
- Owner: lgaticaq
- License: mit
- Created: 2018-08-27T17:43:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2026-02-12T09:56:04.000Z (5 months ago)
- Last Synced: 2026-02-12T18:33:31.063Z (5 months ago)
- Topics: rancher, semantic-release, semantic-release-plugin
- Language: JavaScript
- Size: 1.52 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# semantic-release-rancher
[](https://www.npmjs.com/package/lgaticaq/semantic-release-rancher)
[](https://travis-ci.org/lgaticaq/semantic-release-rancher)
[](https://www.npmjs.com/package/semantic-release-rancher)
[](https://david-dm.org/lgaticaq/semantic-release-rancher)
[](https://david-dm.org/lgaticaq/semantic-release-rancher#info=devDependencies)
[](https://codeclimate.com/github/lgaticaq/semantic-release-rancher/maintainability)
[](https://github.com/semantic-release/semantic-release)
> Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for upgrade service in [Rancher](https://rancher.com/docs/rancher/v1.6/en/cattle/upgrading/).
| Step | Description |
|--------------------|--------------------|
| `verifyConditions` | Verify the presence and the validity of the rancher api key (set via [environment variables](#environment-variables)). |
| `publish` | Upgrade a service with a new version. |
## Install
```bash
npm i -D semantic-release-rancher
```
## Usage
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/configuration.md#configuration):
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"semantic-release-gitlab-registry",
"semantic-release-rancher"
]
}
```
Example .gitlab-ci.yml
```yml
stages:
- test
- release
test:
image: node:alpine
stage: test
before_script:
- npm i
script:
- npm t
release:
image: node:alpine
stage: release
before_script:
- npm i
- docker build -t $CI_REGISTRY_IMAGE .
script:
- npx semantic-release
only:
- master
```
## Configuration
### Environment variables
| Variable | Description |
| --------------------- | ----------------------------------------------------------------------------- |
| `RANCHER_URL` | **Required.** The url of rancher server. Example: https://rancher.example.com |
| `RANCHER_ENVIRONMENT` | **Required.** The environment id. Example: 1a11 |
| `RANCHER_ACCESS_KEY` | **Required.** The API access key. |
| `RANCHER_SECRET_KEY` | **Required.** The API secret key. |
| `RANCHER_STACK` | **Required.** The stack name. |
| `RANCHER_SERVICE` | **Required.** The service name. |
| `RANCHER_SERVICES` | Optional JSON array with objects stack/service to upgrade multiple services. Example: `[{"stack": "myStack1", "service": "myService1"},{"stack": "myStack2", "service": "myService2"}]` |
### Options
| Variable | Description |
| -------------------- | -------------------------------- |
| `rancherUrl` | The url of rancher server. Example: `https://rancher.example.com` |
| `rancherEnvironment` | The environment id. Example: `1a11` |
| `services` | Array of object services. Example: `[{"stack": "MyStack", "service": "MyService"}, {"stack": "MyStack", "service": "MyOtherService", "startFirst": false}]` |
### Examples
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"semantic-release-gitlab-registry",
[
"semantic-release-rancher",
{
"rancherUrl": "https://rancher.example.com",
"rancherEnvironment": "1a11",
"services": [
{
"stack": "MyStack",
"service": "MyService"
},
{
"stack": "MyStack",
"service": "MyOtherService",
"startFirst": false
}
]
}
]
]
}
```
## License
[MIT](https://tldrlegal.com/license/mit-license)