c98130cc08
* ui: Add the most basic workspace root in /ui * We already have a LICENSE file in the repository root * Change directory path in build scripts ui-v2 -> ui * Make yarn install flags configurable from elsewhere * Minimal workspace root makefile * Call the new docker specific target * Update yarn in the docker build image * Reconfigure the netlify target and move to the higher makefile * Move ui-v2 -> ui/packages/consul-ui * Change repo root to refleect new folder structure * Temporarily don't hoist consul-api-double * Fixup CI configuration * Fixup lint errors * Fixup Netlify target
33 lines
892 B
JavaScript
33 lines
892 B
JavaScript
const read = require('fs').readFileSync;
|
|
const exec = require('child_process').execSync;
|
|
|
|
// See tests ../node-tests/config/utils.js
|
|
const repositoryYear = function(date = exec('git show -s --format=%ci HEAD')) {
|
|
return date
|
|
.toString()
|
|
.trim()
|
|
.split('-')
|
|
.shift();
|
|
};
|
|
const repositorySHA = function(sha = exec('git rev-parse --short HEAD')) {
|
|
return sha.toString().trim();
|
|
};
|
|
const binaryVersion = function(repositoryRoot) {
|
|
return function(versionFileContents = read(`${repositoryRoot}/version/version.go`)) {
|
|
// see /scripts/dist.sh:8
|
|
return versionFileContents
|
|
.toString()
|
|
.split('\n')
|
|
.find(function(item, i, arr) {
|
|
return item.indexOf('Version =') !== -1;
|
|
})
|
|
.trim()
|
|
.split('"')[1];
|
|
};
|
|
};
|
|
module.exports = {
|
|
repositoryYear: repositoryYear,
|
|
repositorySHA: repositorySHA,
|
|
binaryVersion: binaryVersion,
|
|
};
|