Adds a UI build in a Docker container. (#2462)
This commit is contained in:
parent
cd2194a56d
commit
e5210166e2
|
@ -59,6 +59,10 @@ vet:
|
||||||
echo "and fix them if necessary before submitting the code for reviewal."; \
|
echo "and fix them if necessary before submitting the code for reviewal."; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# build the static web ui
|
||||||
|
ui:
|
||||||
|
@sh -c "'$(CURDIR)/scripts/ui.sh'"
|
||||||
|
|
||||||
# generates the static web ui that's compiled into the binary
|
# generates the static web ui that's compiled into the binary
|
||||||
static-assets:
|
static-assets:
|
||||||
@echo "--> Generating static assets"
|
@echo "--> Generating static assets"
|
||||||
|
@ -69,4 +73,4 @@ static-assets:
|
||||||
tools:
|
tools:
|
||||||
go get -u -v $(GOTOOLS)
|
go get -u -v $(GOTOOLS)
|
||||||
|
|
||||||
.PHONY: all ci bin dev dist cov test cover format vet static-assets tools
|
.PHONY: all ci bin dev dist cov test cover format vet ui static-assets tools
|
||||||
|
|
|
@ -27,4 +27,3 @@ ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
|
||||||
|
|
||||||
RUN mkdir -p $GOPATH/src/github.com/hashicorp/consul
|
RUN mkdir -p $GOPATH/src/github.com/hashicorp/consul
|
||||||
WORKDIR $GOPATH/src/github.com/hashicorp/consul
|
WORKDIR $GOPATH/src/github.com/hashicorp/consul
|
||||||
CMD ./scripts/dist_build.sh
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ fi
|
||||||
# Do a hermetic build inside a Docker container.
|
# Do a hermetic build inside a Docker container.
|
||||||
if [ -z $NOBUILD ]; then
|
if [ -z $NOBUILD ]; then
|
||||||
docker build -t hashicorp/consul-builder scripts/consul-builder/
|
docker build -t hashicorp/consul-builder scripts/consul-builder/
|
||||||
docker run --rm -v "$(pwd)":/gopath/src/github.com/hashicorp/consul hashicorp/consul-builder
|
docker run --rm -v "$(pwd)":/gopath/src/github.com/hashicorp/consul hashicorp/consul-builder ./scripts/dist_build.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Zip all the files.
|
# Zip all the files.
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Get the parent directory of where this script is.
|
||||||
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
|
|
||||||
|
# Change into that dir because we expect that.
|
||||||
|
cd $DIR
|
||||||
|
|
||||||
|
# Do a hermetic build inside a Docker container.
|
||||||
|
if [ -z $NOBUILD ]; then
|
||||||
|
docker build -t hashicorp/consul-builder scripts/consul-builder/
|
||||||
|
docker run --rm -v "$(pwd)":/gopath/src/github.com/hashicorp/consul hashicorp/consul-builder ./scripts/ui_build.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Get the parent directory of where this script is.
|
||||||
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
|
|
||||||
|
# Change into that dir because we expect that.
|
||||||
|
cd $DIR
|
||||||
|
|
||||||
|
# Build the web assets.
|
||||||
|
pushd ui
|
||||||
|
bundle
|
||||||
|
make dist
|
||||||
|
popd
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in New Issue