bobjana / drone-build-tag

Custom tags for drone 0.7+ builds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drone-build-tag

Custom tags for drone 0.7+ builds. This utility image will try and find the version of the app and genrate a build tag that includes the date, branch and git sha. On builds of the master branch it will just use the app version and latest as the tag.

Run before your build to populate the Environmental Vars that drone uses.

In drone 5+ docker plugin will read PLUGIN_TAGS from a .env file.

Tags:

  • Feature branch: $VERSION-$COMMIT_DATE.$BRANCH.$SHA
  • Master: $VERSION and latest

Use --include-feature-tag to include the feature branch tag on a master branch commit

Searches for verion in the following places:

  • "version": in package.json
  • VERSION= in .version
  • ENV APPLICATION_VERSION in Dockerfile

.drone.yml example

pipeline:
  generate-build-tags:
    image: jgreat/drone-build-tag
    commands:
      - build-tags.sh

  build:
    image: node:8
    commands:
      - npm install
      - npm test

  publish:
    image: plugins/docker
    repo: me/mynodeapp
    # tags will be read from the .env file generated by jgreat/drone-build-tag
...

About

Custom tags for drone 0.7+ builds

License:MIT License


Languages

Language:Shell 100.0%