Set of semantic-release plugins for upgrade service in Rancher.
Step | Description |
---|---|
verifyConditions |
Verify the presence and the validity of the rancher api key (set via environment variables). |
publish |
Upgrade a service with a new version. |
npm i -D semantic-release-rancher
The plugin can be configured in the semantic-release configuration file:
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"semantic-release-gitlab-registry",
"semantic-release-rancher"
]
}
Example .gitlab-ci.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
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"}] |
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}] |
{
"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
}
]
}
]
]
}