Skip to content

Commit

Permalink
PL-40 Add project_up script that wraps skaffold commands and auto gen…
Browse files Browse the repository at this point in the history
…erates template files

Summary:
Add project_up script that auto-generates template files and runs skaffold commands via passing in prod/dev as the first argument.
Also adding gitignore and removing gitignore'd files that are now auto-created by the project_up script.

Test Plan:
```
# for Dev
make skaffold-dev
# for "Staging" (still the dev environment, just not watching changes)
make skaffold-staging
# for Prod (doesn't work because UI doesn't work in Docker as of this commit)
make skaffold-prod
```

Reviewers: kgandhi, michelle, zasgar

Reviewed By: zasgar

Differential Revision: https://phab.corp.pixielabs.ai/D91

GitOrigin-RevId: a10246b
  • Loading branch information
Phillip Kuznetsov committed Oct 25, 2018
1 parent 9b0067c commit f0753d8
Show file tree
Hide file tree
Showing 18 changed files with 352 additions and 382 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ user.bazelrc

# Arc unit test cache
linters/.phutil_module-cache

# Ignore Skaffold Build Directory
skaffold_build/
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ DEP := dep
## Minikube command to use.
MINIKUBE := minikube


## The directory to write template files to for skaffold (with respect to bazel info workspace).
SKAFFOLD_DIR := $$(bazel info workspace)/skaffold_build

.PHONY: clean
clean:
$(BAZEL) clean
$(BAZEL) clean
rm -rf $(SKAFFOLD_DIR)

.PHONY: pristine
pristine:
Expand Down Expand Up @@ -52,6 +57,15 @@ dev-env-teardown: ## Clean up dev environment.
$(MINIKUBE) stop
$(MINIKUBE) delete

skaffold-dev: ## Run Skaffold in the dev environment.
$(BAZEL) run //templates/skaffold:skaffoldtemplate -- --build_dir $(SKAFFOLD_DIR)

skaffold-prod: ## Run Skaffold in the prod environment.
$(BAZEL) run //templates/skaffold:skaffoldtemplate -- --build_dir $(SKAFFOLD_DIR) --prod

skaffold-staging: ## Run Skaffold in the staging environment.
$(BAZEL) run //templates/skaffold:skaffoldtemplate -- --build_dir $(SKAFFOLD_DIR) --staging

help: ## Print help for targets with comments.
@echo "Usage:"
@echo " make [target...] [VAR=foo VAR2=bar...]"
Expand Down
45 changes: 0 additions & 45 deletions services/api/service_dev.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions services/api/service_prod.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions services/auth/service_dev.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions services/auth/service_prod.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion services/gateway/service.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ spec:
- port: 50070
protocol: TCP
targetPort: 50070
nodePort: 30040
nodePort: 30041
selector:
name: gateway-server
45 changes: 0 additions & 45 deletions services/proxy/service_dev.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions services/proxy/service_prod.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions skaffold/skaffold.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build:
deploy:
kubectl:
manifests:
- services/api/service_{{.Deployment}}.yaml
- services/auth/service_{{.Deployment}}.yaml
- services/proxy/service_{{.Deployment}}.yaml
- services/gateway/service_{{.Deployment}}.yaml
- {{.BuildDir}}/services/api/service_{{.Deployment}}.yaml
- {{.BuildDir}}/services/auth/service_{{.Deployment}}.yaml
- {{.BuildDir}}/services/proxy/service_{{.Deployment}}.yaml
- {{.BuildDir}}/services/gateway/service_{{.Deployment}}.yaml
26 changes: 0 additions & 26 deletions skaffold/skaffold_dev.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions skaffold/skaffold_prod.yaml

This file was deleted.

Loading

0 comments on commit f0753d8

Please sign in to comment.