
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
@codedependant/release-config-docker
Advanced tools
Baseline shareable semantic-release configuration for publishing docker images
Semantic release shareable configuration for releasing docker images
// package.json
{
"release": {
"branches": ["main"],
"extends": "@codedependant/release-config-docker",
"dockerImage": "custom-image-name"
}
}
For monorepos it may be desireable to use the same Dockerfile for multiple deployments.
This is possible by pointing the dockerfile
option to its location relative to the sub project
// package.json
{
"release": {
"branches": ["main"],
"extends": "@codedependant/release-config-docker",
"dockerFile": "../../Dockerfile"
}
}
Alternatively
// release.config.js
const path = require('path')
module.exports = {
branches : ['main'],
extends: '@codedependant/release-config-docker',
dockerFile: path.join(__dirname, '..', '..', 'Dockerfile')
}
Option | Description | Default |
---|---|---|
dockerTags | Optional. An array of strings allowing to specify additional tags to apply to the image. Supports templating | [latest , {major}-latest , {version} ] |
dockerImage | Optional. The name of the image to release. | Parsed from package.json name property |
dockerRegistry | Optional. The hostname and port used by the the registry in format hostname[:port] . Omit the port if the registry uses the default port | null (dockerhub) |
dockerProject | Optional. The project or repository name to publish the image to | For scoped packages, the scope will be used, otherwise null |
dockerDockerfile | Optional. The path, relative to $PWD to a Docker file to build the target image with | Dockerfile |
dockerContext | Optional. A path, relative to $PWD to use as the build context A | . |
dockerLogin | Optional. Set to false it by pass docker login if the docker daemon is already authorized | false |
dockerArgs | Optional. Include additional values for docker's build-arg . Supports templating | |
dockerPublish | Optional. Automatically push image tags during the publish phase. | true |
Simple template tag {}
values may be used. Dot notation can be used to extract values from objects
Variable | Description | Type |
---|---|---|
previous | Object with major , minor , patch semver information of the last release published. | Object |
next | Object with major , minor , patch semver information of the release to be published. | Object |
git_sha | The commit SHA of the current release | String |
git_tag | The git tag of the current release | String |
release_type | The severity type of the current build (major , minor , patch ) | String |
relase_notes | The release notes blob associated with the release | String |
version | Sever string of the version being built | String |
major | The major version of the next release | Number |
minor | The minor version of the next release | Number |
patch | The patch version of the next release | Number |
env | Environment variables that were set at build time | Object |
pkg | Values parsed from package.json | Object |
build | The Random build hash representing the current execution context | String |
now | Current timestamp is ISO 8601 format | String |
The build step will be passed a number of default build arguments. If the value of the build argument is true
The build argument value will be omitted allowing the value to be pulled from an environment variable
// package.json
{
"release": {
"extends": "@codedependant/release-config-docker",
"dockerFile": "../../Dockerfile",
"dockerTags": ["latest", "{version}", "{major}-latest", "{major}.{minor}"],
"dockerRegistry": "gcr.io",
"dockerProject": "logdna-k8s",
"dockerArgs": {
"GITHUB_TOKEN": null
}
}
}
> export GITHUB_TOKEN=abc123
> docker build -t gcr.io/logdna-k8s/service-name --build-arg GITHUB_TOKEN -f ../../Dockerfile .
Build Arg | Description | Example |
---|---|---|
SRC_DIRECTORY | The name of the directory the build is being executed | one |
TARGET_PATH | The path to the current src directory relative to the project root | workspace/one |
NPM_PACKAGE_NAME | The name of the current package the build is executing. Sans scope | package-one |
NPM_PACKAGE_SCOPE | The Scope of the current package, if present. Sans @ | scope |
CONFIG_NAME | The name of the image as it is being built. Sans registry. | image-name |
CONFIG_PROJECT | The name of the project the docker image will belong to | logdna-k8s |
GIT_SHA | The commit SHA of the current release | ec6e214f0 |
GIT_TAG | The git tag of the current release | v1.0.0 |
FAQs
Baseline shareable semantic-release configuration for publishing docker images
The npm package @codedependant/release-config-docker receives a total of 2 weekly downloads. As such, @codedependant/release-config-docker popularity was classified as not popular.
We found that @codedependant/release-config-docker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.