Add Makefile/Dockerfile UI bits

This commit is contained in:
Jeff Mitchell
2018-04-03 10:46:45 -04:00
parent 3521f75064
commit 7a312d7c37
2 changed files with 41 additions and 5 deletions

View File

@@ -5,6 +5,8 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST))
TEST?=$$(go list ./... | grep -v /vendor/ | grep -v /integ)
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
EXTERNAL_TOOLS=\
github.com/elazarl/go-bindata-assetfs/... \
github.com/hashicorp/go-bindata/... \
github.com/mitchellh/gox \
github.com/kardianos/govendor \
github.com/client9/misspell/cmd/misspell
@@ -88,6 +90,29 @@ bootstrap:
go get -u $$tool; \
done
static-assets:
@echo "--> Generating static assets"
@go-bindata-assetfs -o bindata_assetfs.go -pkg http -prefix pkg -modtime 1480000000 ./pkg/web_ui/...
@mv bindata_assetfs.go http
@$(MAKE) -f $(THIS_FILE) fmt
test-ember:
@echo "--> Installing JavaScript assets"
@cd ui && yarn install && bower install && yarn install phantomjs-prebuilt
@echo "--> Running ember tests"
@cd ui && node_modules/phantomjs-prebuilt/bin/phantomjs --version
@cd ui && npm test
ember-dist:
@echo "--> Installing JavaScript assets"
@cd ui && yarn install && bower install --allow-root
@cd ui && npm rebuild node-sass
@echo "--> Building Ember application"
@cd ui && npm run build
@rm -rf ui/if-you-need-to-delete-this-open-an-issue-async-disk-cache
static-dist: ember-dist static-assets
proto:
protoc -I helper/forwarding -I vault -I ../../.. vault/*.proto --go_out=plugins=grpc:vault
protoc -I helper/storagepacker helper/storagepacker/types.proto --go_out=plugins=grpc:helper/storagepacker
@@ -130,4 +155,4 @@ hana-database-plugin:
mongodb-database-plugin:
@CGO_ENABLED=0 go build -o bin/mongodb-database-plugin ./plugins/database/mongodb/mongodb-database-plugin
.PHONY: bin default prep test vet bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin
.PHONY: bin default prep test vet bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin static-assets ember-dist static-dist

View File

@@ -1,14 +1,23 @@
# Adapted from tcnksm/dockerfile-gox -- thanks!
FROM debian:testing
RUN apt-get update -y && apt-get install --no-install-recommends -y -q \
curl \
zip \
build-essential \
gcc-multilib \
g++-multilib \
ca-certificates \
git mercurial bzr \
&& rm -rf /var/lib/apt/lists/*
gnupg \
libltdl-dev \
libltdl7
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
RUN rm -rf /var/lib/apt/lists/*
RUN npm install -g bower yarn@0.17.10
ENV GOVERSION 1.10.1
RUN mkdir /goroot && mkdir /gopath
@@ -20,7 +29,9 @@ ENV GOROOT /goroot
ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
RUN go get github.com/mitchellh/gox
RUN go get github.com/elazarl/go-bindata-assetfs/...
RUN go get github.com/hashicorp/go-bindata/...
RUN mkdir -p /gopath/src/github.com/hashicorp/vault
WORKDIR /gopath/src/github.com/hashicorp/vault
CMD make bin
CMD make static-dist bin