mirror of https://github.com/hashicorp/consul
ci: fix bindata autoupdate (#8801)
* update bindata on ui-v2/ changes * Revert "Remove GIT_SHA environment variable" This reverts commitpull/8816/headf620f9aefd
. * Revert "Hardcode in an app version for ember-cli-app-version" This reverts commit5ae493d79b
. * revert modtime change in #8712
parent
526d005d72
commit
8b409529aa
|
@ -641,10 +641,12 @@ jobs:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: .
|
at: .
|
||||||
- run:
|
- run:
|
||||||
name: commit agent/uiserver/bindata_assetfs.go if there are changes
|
name: commit agent/uiserver/bindata_assetfs.go if there are UI changes
|
||||||
command: |
|
command: |
|
||||||
exit 0
|
# check if there are any changes in ui-v2/
|
||||||
if ! git diff --exit-code agent/uiserver/bindata_assetfs.go; then
|
# if there are, we commit the ui static asset file
|
||||||
|
# HEAD^! is shorthand for HEAD^..HEAD (parent of HEAD and HEAD)
|
||||||
|
if ! git diff --quiet --exit-code HEAD^! ui-v2/; then
|
||||||
git config --local user.email "hashicorp-ci@users.noreply.github.com"
|
git config --local user.email "hashicorp-ci@users.noreply.github.com"
|
||||||
git config --local user.name "hashicorp-ci"
|
git config --local user.name "hashicorp-ci"
|
||||||
|
|
||||||
|
@ -653,7 +655,7 @@ jobs:
|
||||||
git commit -m "auto-updated agent/uiserver/bindata_assetfs.go from commit ${short_sha}"
|
git commit -m "auto-updated agent/uiserver/bindata_assetfs.go from commit ${short_sha}"
|
||||||
git push origin master
|
git push origin master
|
||||||
else
|
else
|
||||||
echo "no new static assets to publish"
|
echo "no UI changes so no static assets to publish"
|
||||||
fi
|
fi
|
||||||
- run: *notify-slack-failure
|
- run: *notify-slack-failure
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ lint:
|
||||||
# also run as part of the release build script when it verifies that there are no
|
# also run as part of the release build script when it verifies that there are no
|
||||||
# changes to the UI assets that aren't checked in.
|
# changes to the UI assets that aren't checked in.
|
||||||
static-assets:
|
static-assets:
|
||||||
@go-bindata-assetfs -modtime 1 -pkg uiserver -prefix pkg -o $(ASSETFS_PATH) ./pkg/web_ui/...
|
@go-bindata-assetfs -pkg uiserver -prefix pkg -o $(ASSETFS_PATH) ./pkg/web_ui/...
|
||||||
@go fmt $(ASSETFS_PATH)
|
@go fmt $(ASSETFS_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -249,4 +249,5 @@
|
||||||
<a data-test-footer-copyright href="{{env 'CONSUL_COPYRIGHT_URL'}}/" rel="noopener noreferrer" target="_blank">© {{env 'CONSUL_COPYRIGHT_YEAR'}} HashiCorp</a>
|
<a data-test-footer-copyright href="{{env 'CONSUL_COPYRIGHT_URL'}}/" rel="noopener noreferrer" target="_blank">© {{env 'CONSUL_COPYRIGHT_YEAR'}} HashiCorp</a>
|
||||||
<p data-test-footer-version>Consul {{env 'CONSUL_VERSION'}}</p>
|
<p data-test-footer-version>Consul {{env 'CONSUL_VERSION'}}</p>
|
||||||
<a data-test-footer-docs href="{{env 'CONSUL_DOCS_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a>
|
<a data-test-footer-docs href="{{env 'CONSUL_DOCS_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a>
|
||||||
|
{{{concat '<!-- ' (env 'CONSUL_GIT_SHA') '-->'}}}
|
||||||
</footer>
|
</footer>
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
module.exports = function(environment, $ = process.env) {
|
module.exports = function (environment, $ = process.env) {
|
||||||
let ENV = {
|
let ENV = {
|
||||||
modulePrefix: 'consul-ui',
|
modulePrefix: 'consul-ui',
|
||||||
environment,
|
environment,
|
||||||
|
@ -11,9 +11,6 @@ module.exports = function(environment, $ = process.env) {
|
||||||
// torii provider. We provide this object here to
|
// torii provider. We provide this object here to
|
||||||
// prevent ember from giving a log message when starting ember up
|
// prevent ember from giving a log message when starting ember up
|
||||||
torii: {},
|
torii: {},
|
||||||
'ember-cli-app-version': {
|
|
||||||
version: 'consul-ui',
|
|
||||||
},
|
|
||||||
EmberENV: {
|
EmberENV: {
|
||||||
FEATURES: {
|
FEATURES: {
|
||||||
// Here you can enable experimental features on an ember canary build
|
// Here you can enable experimental features on an ember canary build
|
||||||
|
@ -37,7 +34,7 @@ module.exports = function(environment, $ = process.env) {
|
||||||
CONSUL_UI_DISABLE_REALTIME: typeof process.env.CONSUL_UI_DISABLE_REALTIME !== 'undefined',
|
CONSUL_UI_DISABLE_REALTIME: typeof process.env.CONSUL_UI_DISABLE_REALTIME !== 'undefined',
|
||||||
CONSUL_UI_DISABLE_ANCHOR_SELECTION:
|
CONSUL_UI_DISABLE_ANCHOR_SELECTION:
|
||||||
typeof process.env.CONSUL_UI_DISABLE_ANCHOR_SELECTION !== 'undefined',
|
typeof process.env.CONSUL_UI_DISABLE_ANCHOR_SELECTION !== 'undefined',
|
||||||
CONSUL_COPYRIGHT_YEAR: (function(val) {
|
CONSUL_COPYRIGHT_YEAR: (function (val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +45,17 @@ module.exports = function(environment, $ = process.env) {
|
||||||
.split('-')
|
.split('-')
|
||||||
.shift();
|
.shift();
|
||||||
})(process.env.CONSUL_COPYRIGHT_YEAR),
|
})(process.env.CONSUL_COPYRIGHT_YEAR),
|
||||||
CONSUL_VERSION: (function(val) {
|
CONSUL_GIT_SHA: (function (val) {
|
||||||
|
if (val) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
return require('child_process')
|
||||||
|
.execSync('git rev-parse --short HEAD')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
})(process.env.CONSUL_GIT_SHA),
|
||||||
|
CONSUL_VERSION: (function (val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +64,7 @@ module.exports = function(environment, $ = process.env) {
|
||||||
const contents = fs.readFileSync(version_go).toString();
|
const contents = fs.readFileSync(version_go).toString();
|
||||||
return contents
|
return contents
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.find(function(item, i, arr) {
|
.find(function (item, i, arr) {
|
||||||
return item.indexOf('Version =') !== -1;
|
return item.indexOf('Version =') !== -1;
|
||||||
})
|
})
|
||||||
.trim()
|
.trim()
|
||||||
|
|
Loading…
Reference in New Issue