Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
update makefile(s) to allow running 'make test' without entering 'web'
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Jul 30, 2018
1 parent e4a3972 commit 38b5724
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 51 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ UI = $(shell find ui/ -name "*.js")

DOCKER_REPO ?= replicated

build-deps:
.state/build-deps: Makefile
go get -u github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports
go get github.com/elazarl/go-bindata-assetfs/...
go get -u github.com/jteeuwen/go-bindata/...
@mkdir -p .state/
@touch .state/build-deps

build-deps: .state/build-deps

dep-deps:
go get -u github.com/golang/dep/cmd/dep
Expand Down Expand Up @@ -129,7 +132,7 @@ deps:
dep ensure -v


fmt:
fmt: .state/build-deps
goimports -w pkg
goimports -w cmd

Expand Down Expand Up @@ -193,8 +196,8 @@ goreleaser: .state/goreleaser

.state/goreleaser: .goreleaser.unstable.yml deploy/Dockerfile $(SRC)
@mkdir -p .state
@touch .state/goreleaser
curl -sL https://git.io/goreleaser | bash -s -- --snapshot --rm-dist --config .goreleaser.unstable.yml
@touch .state/goreleaser

run: bin/ship
./bin/ship --log-level=debug --studio-file=./app.yml
Expand All @@ -206,13 +209,16 @@ build_yoonit_docker_image:
build_ship_integration_test:
docker build -t $(DOCKER_REPO)/ship-e2e-test:latest -f ./integration/base/Dockerfile .

pkg/lifeycle/daemon/ui.bindatafs.go: $(UI)
web/.state/build_ship:
$(MAKE) -C web .state/build_ship

pkg/lifeycle/daemon/ui.bindatafs.go: .state/build-deps $(UI) web/.state/build_ship
cd web; go-bindata-assetfs -pkg daemon \
-o ../pkg/lifecycle/daemon/ui.bindatafs.go \
dist/...

embed-ui: pkg/lifeycle/daemon/ui.bindatafs.go

build-ui:
build-ui:
cd web; yarn install --force
cd web; `yarn bin`/webpack --config webpack.config.js --env ship --mode production
86 changes: 43 additions & 43 deletions pkg/lifecycle/daemon/ui.bindatafs.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ yarn-error.log*
.vscode/
.idea/
/node_modules
/.state/
20 changes: 17 additions & 3 deletions web/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
.PHONY: clean deps serve_config serve_ship build_ship embed_ship test

SHELL := /bin/bash
$SRC = $(shell find . -path "./node_modules" -prune -o -path "./dist" -prune -o \( -name "*.js" -o -name "*.jsx" -o -name "*.scss" -o -name "*.json" -o -name "*.svg" -o -name "*.png" \) -print)

.state/package: package.json package-lock.json yarn.lock
yarn install
@mkdir -p .state
@touch .state/package

clean:
rm -rf node_modules
rm -rf dist
rm -rf .state

deps:
yarn install
deps: .state/package

serve_config:
`yarn bin`/webpack-dev-server --config webpack.config.js --progress -w --debug --env configOnly --mode development

serve_ship:
`yarn bin`/webpack-dev-server --config webpack.config.js --progress -w --debug --env shipDev --mode development

build_ship:
.state/build_ship: .state/package $(SRC)
`yarn bin`/webpack --config webpack.config.js --env ship --mode production
@mkdir -p .state
@touch .state/build_ship

build_ship: .state/build_ship

embed_ship:
rm -r ${GOPATH}/src/github.com/replicatedhq/ship/ui/*
Expand Down

0 comments on commit 38b5724

Please sign in to comment.