Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old UI #5643

Merged
merged 6 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Thumbs.db
bin/
changelog.tmp
exit-code
ui/.bundle
ui/.sass-cache
ui/dist/
ui/static/application.min.js
ui/static/base.css
ui/vendor
website/.bundle
website/build/
website/npm-debug.log
Expand Down
17 changes: 4 additions & 13 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ endif
CONSUL_DEV_IMAGE?=consul-dev
GO_BUILD_TAG?=consul-build-go
UI_BUILD_TAG?=consul-build-ui
UI_LEGACY_BUILD_TAG?=consul-build-ui-legacy
BUILD_CONTAINER_NAME?=consul-builder

DIST_TAG?=1
Expand Down Expand Up @@ -88,7 +87,6 @@ NOGOX?=1
export NOGOX
export GO_BUILD_TAG
export UI_BUILD_TAG
export UI_LEGACY_BUILD_TAG
export BUILD_CONTAINER_NAME
export GIT_COMMIT
export GIT_DIRTY
Expand Down Expand Up @@ -223,7 +221,7 @@ static-assets:


# Build the static web ui and build static assets inside a Docker container
ui: ui-legacy-docker ui-docker static-assets-docker
ui: ui-docker static-assets-docker

tools:
go get -u -v $(GOTOOLS)
Expand All @@ -239,7 +237,7 @@ version:
@$(SHELL) $(CURDIR)/build-support/scripts/version.sh -r -g


docker-images: go-build-image ui-build-image ui-legacy-build-image
docker-images: go-build-image ui-build-image

go-build-image:
@echo "Building Golang build container"
Expand All @@ -249,10 +247,6 @@ ui-build-image:
@echo "Building UI build container"
@docker build $(NOCACHE) $(QUIET) -t $(UI_BUILD_TAG) - < build-support/docker/Build-UI.dockerfile

ui-legacy-build-image:
@echo "Building Legacy UI build container"
@docker build $(NOCACHE) $(QUIET) -t $(UI_LEGACY_BUILD_TAG) - < build-support/docker/Build-UI-Legacy.dockerfile

static-assets-docker: go-build-image
@$(SHELL) $(CURDIR)/build-support/scripts/build-docker.sh static-assets

Expand All @@ -262,12 +256,9 @@ consul-docker: go-build-image
ui-docker: ui-build-image
@$(SHELL) $(CURDIR)/build-support/scripts/build-docker.sh ui

ui-legacy-docker: ui-legacy-build-image
@$(SHELL) $(CURDIR)/build-support/scripts/build-docker.sh ui-legacy

proto:
protoc agent/connect/ca/plugin/*.proto --gofast_out=plugins=grpc:../../..

.PHONY: all ci bin dev dist cov test test-ci test-internal test-install-deps cover format vet ui static-assets tools
.PHONY: docker-images go-build-image ui-build-image ui-legacy-build-image static-assets-docker consul-docker ui-docker
.PHONY: ui-legacy-docker version proto
.PHONY: docker-images go-build-image ui-build-image static-assets-docker consul-docker ui-docker
.PHONY: version proto
17 changes: 2 additions & 15 deletions agent/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"net/http"
"net/http/pprof"
"net/url"
"os"
"reflect"
"regexp"
"strconv"
Expand Down Expand Up @@ -218,29 +217,17 @@ func (s *HTTPServer) handler(enableDebug bool) http.Handler {
handlePProf("/debug/pprof/trace", pprof.Trace)

if s.IsUIEnabled() {
legacy_ui, err := strconv.ParseBool(os.Getenv("CONSUL_UI_LEGACY"))
if err != nil {
legacy_ui = false
}
var uifs http.FileSystem

// Use the custom UI dir if provided.
if s.agent.config.UIDir != "" {
uifs = http.Dir(s.agent.config.UIDir)
} else {
fs := assetFS()

if legacy_ui {
fs.Prefix += "/v1/"
} else {
fs.Prefix += "/v2/"
}
fs.Prefix += "/v2/"
freddygv marked this conversation as resolved.
Show resolved Hide resolved
uifs = fs
}

if !legacy_ui {
uifs = &redirectFS{fs: uifs}
}
uifs = &redirectFS{fs: uifs}

mux.Handle("/robots.txt", http.FileServer(uifs))
mux.Handle("/ui/", http.StripPrefix("/ui/", http.FileServer(uifs)))
Expand Down
16 changes: 0 additions & 16 deletions build-support/docker/Build-UI-Legacy.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion build-support/functions/00-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ HASHICORP_GPG_KEY="348FFC4C"

# Default Image Names
UI_BUILD_CONTAINER_DEFAULT="consul-build-ui"
UI_LEGACY_BUILD_CONTAINER_DEFAULT="consul-build-ui-legacy"
GO_BUILD_CONTAINER_DEFAULT="consul-build-go"

# Whether to colorize shell output
Expand Down
47 changes: 0 additions & 47 deletions build-support/functions/20-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,53 +122,6 @@ function build_ui {
return $ret
}

function build_ui_legacy {
# Arguments:
# $1 - Path to the top level Consul source
# $2 - The docker image to run the build within (optional)
#
# Returns:
# 0 - success
# * - error

if ! test -d "$1"
then
err "ERROR: '$1' is not a directory. build_ui_legacy must be called with the path to the top level source as the first argument'"
return 1
fi

local sdir="$1"
local ui_legacy_dir="${sdir}/ui"

local image_name=${UI_LEGACY_BUILD_CONTAINER_DEFAULT}
if test -n "$2"
then
image_name="$2"
fi

pushd ${ui_legacy_dir} > /dev/null
status "Creating the Legacy UI Build Container with image: ${image_name}"
rm -r ${sdir}/pkg/web_ui/v1 >/dev/null 2>&1
mkdir -p ${sdir}/pkg/web_ui/v1
local container_id=$(docker create -it ${image_name})
local ret=$?
if test $ret -eq 0
then
status "Copying the source from '${ui_legacy_dir}' to /consul-src/ui within the container"
(
docker cp . ${container_id}:/consul-src/ui &&
status "Running build in container" &&
docker start -i ${container_id} &&
status "Copying back artifacts" &&
docker cp ${container_id}:/consul-src/pkg/web_ui/v1/. ${sdir}/pkg/web_ui/v1
)
ret=$?
docker rm ${container_id} > /dev/null
fi
popd > /dev/null
return $ret
}

function build_assetfs {
# Arguments:
# $1 - Path to the top level Consul source
Expand Down
8 changes: 0 additions & 8 deletions build-support/functions/30-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,6 @@ function build_release {
return 1
fi

status_stage "==> Building Legacy UI for version ${vers}"
build_ui_legacy "${sdir}" "${UI_LEGACY_BUILD_TAG}"
if test $? -ne 0
then
err "ERROR: Failed to build the legacy ui"
return 1
fi

status_stage "==> Building UI for version ${vers}"
# passing the version to override the version determined via tags
build_ui "${sdir}" "${UI_BUILD_TAG}" "${vers}"
Expand Down
14 changes: 2 additions & 12 deletions build-support/scripts/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source "${SCRIPT_DIR}/functions.sh"

function usage {
cat <<-EOF
Usage: ${SCRIPT_NAME} (consul|ui|ui-legacy|static-assets) [<options ...>]
Usage: ${SCRIPT_NAME} (consul|ui|static-assets) [<options ...>]

Description:
This script will build the various Consul components within docker containers
Expand Down Expand Up @@ -81,7 +81,7 @@ function main {
refresh=1
shift
;;
consul | ui | ui-legacy | static-assets )
consul | ui | static-assets )
command="$1"
shift
;;
Expand Down Expand Up @@ -130,16 +130,6 @@ function main {
build_ui "${sdir}" "${image}" || return 1
status "==> UI Built with Version: $(ui_version ${sdir}/pkg/web_ui/v2/index.html), Logo: $(ui_logo_type ${sdir}/pkg/web_ui/v2/index.html)"
;;
ui-legacy )
if is_set "${refresh}"
then
status_stage "==> Refreshing Legacy UI build container image"
export UI_LEGACY_BUILD_TAG="${image:-${UI_LEGACY_BUILD_CONTAINER_DEFAULT}}"
refresh_docker_images "${sdir}" ui-legacy-build-image || return 1
fi
status_stage "==> Building UI"
build_ui_legacy "${sdir}" "${image}" || return 1
;;
* )
err_usage "ERROR: Unknown command: '${command}'"
return 1
Expand Down
12 changes: 0 additions & 12 deletions ui/GNUmakefile

This file was deleted.

7 changes: 0 additions & 7 deletions ui/Gemfile

This file was deleted.

32 changes: 0 additions & 32 deletions ui/Gemfile.lock

This file was deleted.

80 changes: 0 additions & 80 deletions ui/README.md

This file was deleted.

Loading