Sign inSign up

cloudiverse/ghr

By cloudiverse

Updated about 6 years ago

GHR Container Image

Image
0

2.7K

cloudiverse/ghr repository overview

GHR Container

Build Status

This is an alpine-based container that contains GHR. Two versions are available depending on the preferred entrypoint.

Image Variants

The cloudiverse/ghr images come in many flavors, each designed for a specific use case.

cloudiverse/ghr:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It contains only the ghr with the same entrypoint.

This tag is based off of the golang container

cloudiverse/awscli:<version>-bash

This image is the same with only the entrypoint changed. This will likely be used mostly within CI pipelines.

Usage

To use, run the container with your github repository mounted to it (or using the docker.inside functionality in Jenkins) and just run aws with the appropriate parameters for the tool (see below).

Note: You will need to tag the new version before you push the release.

Jenkins Example:

withEnv(['GITHUB_API=https://github.mycompany.com/api/v3/']) { // This line is needed if using GitHub Enterprise
    withCredentials([usernamePassword(credentialsId: '<your_github_credentials_id>', passwordVariable: 'GITHUB_TOKEN', usernameVariable: 'GITHUB_USER')]) {
        docker.image('cloudiverse/ghr:<version>').inside {
            sh """
                git tag ${NEW_VERSION}
                ghr -u ${GH_ORG} -t "${GITHUB_TOKEN}" -r ${GH_REPO} -soft ${NEW_VERSION} ${SOURCE_DIR} 
            """
        }
    }
}

Note: If using Jenkins, ensure that Fetch Tags is enabled.

Required Environment Variables

Human Defined:

  • NEW_VERSION - New semantic version tag
  • GH_ORG - GitHub Organization
  • GH_REPO - GitHub Repository
  • SOURCE_DIR - The file to use as the artifact - can also be a folder with multiple artifacts
  • GITHUB_USER - Username for authenticating to the GitHub API
  • GITHUB_TOKEN - Personal access token for authenticating to the GitHub API

Tag summary

Content type

Image

Digest

Size

146.6 MB

Last updated

about 6 years ago

docker pull cloudiverse/ghr