1.0.0-semantically-released • Published 6 years ago

@heysailor/semantic-release-docker v1.0.0-semantically-released

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@iteratec/semantic-release-docker

semantic-release

A semantic-release plugin to use semantic versioning for docker images.

verifyConditions

verifies that environment variables for authentication via username and password are set. It uses a registry server provided via config or environment variable (preferred) or defaults to docker hub if none is given. It also verifies that the credentials are correct by logging in to the given registry.

prepare

tags the specified image with the version number determined by semantic-release and additional tags provided in the configuration. In addition it supports specifying a complete image name (CIN) via configuration settings according to the canonical format specified by docker:

[registryhostname[:port]/][username/]imagename[:tag]

publish

pushes the tagged images to the registry.

Configuration

docker registry authentication

The docker registry authentication is required and can be set via environment variables.

Environment variables

VariableDescription
DOCKER_REGISTRY_URLThe hostname and port used by the desired docker registry. Leave blank to use docker hub.
DOCKER_REGISTRY_USERThe user name to authenticate with at the registry.
DOCKER_REGISTRY_PASSWORDThe password used for authentication at the registry.

Options

OptionDescription
additionalTagsOptional. An array of strings allowing to specify additional tags to apply to the image.
imageNameRequired The name of the image to release.
registryUrlOptional. The hostname and port used by the the registry in format hostname[:port]. Omit the port if the registry uses the default port
repositoryNameOptional. The name of the repository in the registry, e.g. username on docker hub

Usage

full configuration:

{
  "verifyConfig": ["@iteratec/semantic-release-docker"],
  "prepare": {
    "path": "@iteratec/semantic-release-docker",
    "additionalTags": ["test", "demo"],
    "imageName": "my-image",
    "registryUrl": "my-private-registry:5678",
    "respositoryName": "my-repository"
  },
  "publish": {
    "path": "@iteratec/semantic-release-docker"
  }
}

results in my-private-registry:5678/my-repository/my-image with tags test, demo and the <semver> determined by semantic-release.

minimum configuration:

{
  "verifyConfig": ["@iteratec/semantic-release-docker"],
  "prepare": {
    "path": "@iteratec/semantic-release-docker",
    "imageName": "my-image"
  },
  "publish": {
    "path": "@iteratec/semantic-release-docker"
  }
}

results in my-image:<semver>