Skip to content

jgreat/drone-build-tag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drone-build-tag

Custom tags for drone 0.7+ builds. This utility image will try and find the version of the app and generate 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 .tags 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 .tags file generated by jgreat/drone-build-tag
...