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

semantic-release-docker-tag

v1.1.1

Published

A Semantic release plugin, which uses http requests to tag an already pushed image with the semantic tags

Downloads

8

Readme

semantic-release-docker-tag

A package to use semantic-release with docker images, without the need of a docker binary.

Why?

Other semantic-release plugins for docker will require a docker binary and the image pulled/build to local storage. This plugins adds the new version tag to an already pushed image.

Supported Steps

verifyConditions

Verifies that required settings are set and tries to load source manifest with provided credentials

publish

Fetches the source manifest and pushes it with the new version

Tested registries

The authentication was tested with the following registries

  • harbor
  • nexus
  • github
  • dockerhub
  • gitlab registry

Installation

npm i --save-dev semantic-release-docker-tag

or

yarn add -D semantic-release-docker-tag

And include the plugin inside the plugins section of the semantic-release configuration.

{
  "plugins": [
    ...,
    "semantic-release-docker-tag"
  ]
}

Configuration

Every option can be set using Environment variable or the plugin config

Example:

{
  "plugins": [
    ["semantic-release-docker-tag", {
            
      }
    ]
  ]
}

| Config Option | Environment variable | Required | Default | Description | |--------------------|----------------------|----------|----------------------|-------------------------------------------------------------| | registryUrl | REGISTRY_URL | No | registry.docker.io | URL of the remote registry, without any protocol | | registryProtocol | REGISTRY_PROTOCOL | No | https | Protocol of the remote registry, https or http | | registryUser | REGISTRY_USER | Yes | - | The user used to access the registry | | registryPassword | REGISTRY_PASSWORD | Yes | - | The password for the user used | | sourceTag | SOURCE_TAG | Yes | - | The source tag which should be retagged (ex. $COMMIT_SHA) | | registryImage | REGISTRY_IMAGE | Yes | - | The image receiving the version (ex hello/world) |

Example CI Config

Gitlab

stages:
  - build-docker
  - semantic-release

build-image:
  stage: build-docker
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --context . --dockerfile ./Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --destination $CI_REGISTRY_IMAGE:branch-$CI_COMMIT_BRANCH
    
semantic-release:
  stage: semantic-release
  image: node
  before_script:
    - npm install semantic-release
    - npm install @semantic-release/git
    - npm install @semantic-release/gitlab    
    - npm install semantic-release-docker-tag
  script:
     # Gitlab CI Variables already set in project settings
     # REGISTRY_USER, REGISTRY_PASSWORD, REGISTRY_URL, REGISTRY_IMAGE
    - export SOURCE_TAG=$CI_COMMIT_SHA
    - |
      cat > .releaserc << EOF
      {
        "branches": ["master", "main"],
        "debug": true,
        "plugins": [
          "@semantic-release/commit-analyzer",
          "@semantic-release/gitlab",
          "semantic-release-docker-tag"
        ]
      }
      EOF
    - semantic-release
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH 
      when: always