Skip to content

Feature/dashboard #211

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

Merged
merged 23 commits into from
Jul 9, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Building dashboard in docker
ewoutp committed Jul 6, 2018

Verified

This commit was signed with the committer’s verified signature. The key has expired.
ewoutp Ewout Prangsma
commit 37b54962a2c323102dd5d42930ec6a7de446601d
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ endif
ifndef ENTERPRISEIMAGE
ENTERPRISEIMAGE := $(DEFAULTENTERPRISEIMAGE)
endif
DASHBOARDBUILDIMAGE := kube-arangodb-dashboard-builder

ifndef ALLOWCHAOS
ALLOWCHAOS := true
@@ -111,7 +112,7 @@ build: check-vars docker manifests

.PHONY: clean
clean:
rm -Rf $(BIN) $(BINDIR) $(GOBUILDDIR) $(DASHBOARDDIR)/node_modules
rm -Rf $(BIN) $(BINDIR) $(GOBUILDDIR) $(DASHBOARDDIR)/build $(DASHBOARDDIR)/node_modules

.PHONY: check-vars
check-vars:
@@ -191,11 +192,14 @@ update-generated: $(GOBUILDDIR)
verify-generated:
@${MAKE} -B -s VERIFYARGS=--verify-only update-generated

$(DASHBOARDDIR)/node_modules:
cd $(DASHBOARDDIR) && npm install

dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/node_modules
cd $(DASHBOARDDIR) && npm run-script build
dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/Dockerfile.build
cd $(DASHBOARDDIR) && docker build -t $(DASHBOARDBUILDIMAGE) -f Dockerfile.build $(DASHBOARDDIR)
@mkdir -p $(DASHBOARDDIR)/build
docker run --rm \
-v $(DASHBOARDDIR)/build:/usr/code/build \
-v $(DASHBOARDDIR)/public:/usr/code/public:ro \
-v $(DASHBOARDDIR)/src:/usr/code/src:ro \
$(DASHBOARDBUILDIMAGE)
$(GOASSETSBUILDER) -s /dashboard/build/ -o dashboard/assets.go -p dashboard dashboard/build

$(BIN): $(GOBUILDDIR) $(CACHEVOL) $(SOURCES) dashboard/assets.go
8 changes: 8 additions & 0 deletions dashboard/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/node_modules

# testing
/coverage

# production
/build

14 changes: 14 additions & 0 deletions dashboard/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:10.6-alpine

RUN mkdir -p /usr/code
ADD package-lock.json /usr/code/
ADD package.json /usr/code/

RUN cd /usr/code/ && npm install

VOLUME /usr/code/build
VOLUME /usr/code/public
VOLUME /usr/code/src

WORKDIR /usr/code/
CMD ["npm", "run-script", "build"]
114 changes: 57 additions & 57 deletions dashboard/assets.go

Large diffs are not rendered by default.