/git-tag-buildkite-plugin

A plugin for buildkite which will tag the current repo/version with a tag

Primary LanguageShellOtherNOASSERTION

Git Tag Buildkite Plugin

A Buildkite plugin to tag the current head with a version and push it to the repo. Also makes a release in Github if you provide the right details

Based heavily on Git Commit.

Example

With no options, tags the $BUILDKITE_BRANCH and pushes the tags, with a commit message like Build #4:

steps:
  - command: make
    plugins:
      - tendnz/git-tag#v1.0.11:
          version: "v1.0.0-prod" 

With all options customized:

steps:
  - command: make
    plugins:
      - tendnz/git-tag#v1.0.11:
          version: "v1.0.0-prod"
          message: "Release to $ENV [$BUILDKITE_BUILD_NUMBER]"
          githubtoken: $MY_GITHUB_TOKEN
          reponame: tendnz/my-repo-name
          prerelease: true
          releasenotes: true
          user:
            - name: Bob Monkey
            - email: bob@codemonkeys.com

Configuration

  • version (required))

    A tag to use in git tag $VERSION

  • message (optional, defaults to $BUILDKITE_ORGANIZATION_SLUG/$BUILDKITE_PIPELINE_SLUG: Build $BUILDKITE_BUILD_NUMBER for $BUILDKITE_BRANCH")

    The commit message

  • githubtoken (optional, required to enable releases)

    If provided, this will attempt to make a release. Load your token into your ENV (as per all secrets) then use

      githubtoken: $YOUR_ENV_NAME
    

    DONT put it into the YML!

  • reponame (optional, but required if you want releases)

    The name of the repo, eg tendnz/my-reop-name

  • prerelease (optional, defaults to false)

    Mark this as a prerelease or not.

  • draft (optional, defaults to false)

    Mark this as a draft or not.

  • user.email (optional)

    If given, will configure the git user email for the repo.

  • user.name (optional)

    If given, will configure the git user name for the repo.

  • releasenotes (optional, defaults to false)

    Generate release notes or not.

Tests / Linting

To run the tests of this plugin, run

docker-compose run --rm tests

To run the Buildkite Plugin Linter, run

docker-compose run --rm lint

License

MIT (see LICENSE)