npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@codedependant/release-config-docker

v1.0.1

Published

Baseline shareable semantic-release configuration for publishing docker images

Downloads

4

Readme

release-config-docker

Semantic release shareable configuration for releasing docker images

Usage

// package.json
{
  "release": {
    "branches": ["main"],
    "extends": "@codedependant/release-config-docker",
    "dockerImage": "custom-image-name"
  }
}

Monorepos

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')
}

Options

| 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

Tag Template

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 |

Build Arguments

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 .

Default Build Arguments

| 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 |