An ember-cli-deploy plugin to generate git artefacts
This plugin generates git artefacts into files like
○ $:> cat dist/branch.txt
release/v1.2
○ $:> cat dist/tag.txt
v1.2.0
○ $:> cat dist/revision.txt
2a8bc4a42a221e038dfec684a98aa2cd521c4ee9
A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks.
For more information on what plugins are and how they work, please refer to the Plugin Documentation.
Run the following command in your terminal:
○ $:> ember install ember-cli-deploy-git-artefacts --save-dev
To get up and running quickly, do the following:
-
Ensure ember-cli-deploy-build is installed and configured.
-
Install this plugin
-
Place the following configuration into
config/deploy.js
// All artefacts are optional, choose whatever you need.
// "file" option is customizable filepath inside of a "dist" folder.
var ENV = {
'git-artefacts': {
git: [{
artefact: 'branch-name',
file: 'branch.txt'
}, {
artefact: 'tag-name',
file: 'tag.txt'
}, {
artefact: 'commit-hash-short',
file: 'hash-short.txt'
}, {
artefact: 'commit-hash-long',
file: 'hash-long.txt'
}]
}
};
- Run the pipeline
○ $:> ember deploy
For detailed information on what plugin hooks are and how they work, please refer to the Pipeline Hooks Documentation.
prepare
Plugin will do nothing if it's set to false
.
Default: true
List of git artefacts and target files where to generate them.
Available artefacts are:
branch-name
tag-name
commit-hash-long
commit-hash-short
Default: undefined
The root directory where the artefact files should be placed. By default, this option will use the distDir
property of the deployment context, provided by ember-cli-deploy-build.
Default: context.distDir
The following properties are expected to be present on the deployment context
object:
distDir
(provided by ember-cli-deploy-build)