From 87f6617eecd23a64add1e79eb3cd8dc3da9e649e Mon Sep 17 00:00:00 2001 From: Alvin Huang <17609145+alvin-huang@users.noreply.github.com> Date: Tue, 29 Sep 2020 17:03:45 -0400 Subject: [PATCH] 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 Co-authored-by: hashicorp-ci --- .circleci/config.yml | 33 +++++++++++++++++-- GNUmakefile | 2 +- .../app/components/hashicorp-consul/index.hbs | 1 - ui-v2/config/environment.js | 13 ++------ 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06bcda1f4f..299657b55b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/GNUmakefile b/GNUmakefile index fdf88643c9..b9540879ee 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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) diff --git a/ui-v2/app/components/hashicorp-consul/index.hbs b/ui-v2/app/components/hashicorp-consul/index.hbs index 4433ea5538..3ecd0d8589 100644 --- a/ui-v2/app/components/hashicorp-consul/index.hbs +++ b/ui-v2/app/components/hashicorp-consul/index.hbs @@ -249,5 +249,4 @@ © {{env 'CONSUL_COPYRIGHT_YEAR'}} HashiCorp

Consul {{env 'CONSUL_VERSION'}}

Documentation - {{{concat ''}}} \ No newline at end of file diff --git a/ui-v2/config/environment.js b/ui-v2/config/environment.js index e9523bb559..758fcbb859 100644 --- a/ui-v2/config/environment.js +++ b/ui-v2/config/environment.js @@ -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;