ci:add check for bindata_assetfs changes (#8712)

* add check for bindata_assetfs changes

* Remove GIT_SHA environment variable

* Hardcode in an app version for ember-cli-app-version

* change ' to " for CONSUL_UI_SETTINGS_PLACEHOLDER

Co-authored-by: John Cowen <jcowen@hashicorp.com>
Co-authored-by: hashicorp-ci <hashicorp-ci@users.noreply.github.com>
This commit is contained in:
Alvin Huang 2020-09-29 17:03:45 -04:00 committed by GitHub
parent 10dc269fd4
commit a7353d925e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 15 deletions

View File

@ -629,6 +629,29 @@ jobs:
- ./agent/bindata_assetfs.go
- run: *notify-slack-failure
# commits static assets to git
publish-static-assets:
docker:
- image: *GOLANG_IMAGE
steps:
- checkout
- add_ssh_keys: # needs a key to push updated static asset commit back to github
fingerprints:
- "c9:04:b7:85:bf:0e:ce:93:5f:b8:0e:68:8e:16:f3:71"
- attach_workspace:
at: .
- run:
name: commit agent/bindata_assetfs.go if there are changes
command: |
if git diff --exit-code agent/bindata_assetfs.go; then
git add agent/bindata_assetfs.go
git commit -m "auto-updated agent/bindata_assetfs.go"
git push origin master
else
echo "no new static assets to publish"
fi
- run: *notify-slack-failure
# run ember frontend tests
ember-test-oss:
docker:
@ -806,7 +829,6 @@ workflows:
requires: [dev-build]
- go-test-race: *filter-ignore-non-go-branches
- go-test-sdk: *filter-ignore-non-go-branches
build-distros:
jobs:
- check-vendor: *filter-ignore-non-go-branches
@ -828,6 +850,13 @@ workflows:
- build-static-assets:
requires:
- ember-build-prod
- publish-static-assets:
filters:
branches:
only:
- master
requires:
- build-static-assets
- dev-build:
requires:
- build-static-assets
@ -871,7 +900,6 @@ workflows:
- envoy-integration-test-1.15.0:
requires:
- dev-build
website:
jobs:
- build-website-docker-image:
@ -880,7 +908,6 @@ workflows:
branches:
only:
- master
- algolia-index:
context: consul-docs
filters:

View File

@ -306,7 +306,7 @@ lint:
# 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.
static-assets:
@go-bindata-assetfs -pkg agent -prefix pkg -o $(ASSETFS_PATH) ./pkg/web_ui/...
@go-bindata-assetfs -modtime 1 -pkg agent -prefix pkg -o $(ASSETFS_PATH) ./pkg/web_ui/...
@go fmt $(ASSETFS_PATH)

View File

@ -249,5 +249,4 @@
<a data-test-footer-copyright href="{{env 'CONSUL_COPYRIGHT_URL'}}/" rel="noopener noreferrer" target="_blank">&copy; {{env 'CONSUL_COPYRIGHT_YEAR'}} HashiCorp</a>
<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>
{{{concat '<!-- ' (env 'CONSUL_GIT_SHA') '-->'}}}
</footer>

View File

@ -11,6 +11,9 @@ module.exports = function(environment, $ = process.env) {
// torii provider. We provide this object here to
// prevent ember from giving a log message when starting ember up
torii: {},
'ember-cli-app-version': {
version: 'consul-ui',
},
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
@ -45,16 +48,6 @@ module.exports = function(environment, $ = process.env) {
.split('-')
.shift();
})(process.env.CONSUL_COPYRIGHT_YEAR),
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) {
return val;