Skip to content
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

Separate the build recipe in federation Makefile into separate phases. #30745

Merged
merged 2 commits into from
Oct 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 46 additions & 2 deletions federation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,50 @@ else
MAKEFLAGS += -s
endif

.PHONY: all
all: init build push deploy

.PHONY: init
init:
./develop/develop.sh init

.PHONY: build
build:
./build.sh $(do)
build: build_binaries build_image

.PHONY: push
push:
./develop/develop.sh push

.PHONY: deploy
deploy: deploy_clusters deploy_federation

.PHONY: destroy
destroy: destroy_federation destroy_clusters

.PHONY: build_binaries
build_binaries:
./develop/develop.sh build_binaries

.PHONY: build_image
build_image:
./develop/develop.sh build_image

.PHONY: deploy_clusters
deploy_clusters:
./develop/develop.sh deploy_clusters

.PHONY: deploy_federation
deploy_federation:
./develop/develop.sh deploy_federation

.PHONY: destroy_federation
destroy_federation:
./develop/develop.sh destroy_federation

.PHONY: destroy_clusters
destroy_clusters:
./develop/develop.sh destroy_clusters

.PHONY: redeploy_federation
redeploy_federation:
./develop/develop.sh redeploy_federation
19 changes: 2 additions & 17 deletions federation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ make push

To initialize the deployment run:

(This pull the installer images)
(This pulls the installer images)

```shell
make init
Expand All @@ -57,22 +57,7 @@ make destroy

# Ideas for improvement

1. Split the `build` phase (make recipe) into multiple phases:
1. `init`: pull installer images
2. `build-binaries`
3. `build-docker`
4. `build`: build-binary + build-docker
5. `push`: to push the built images
6. `genconfig`
7. `deploy-clusters`
8. `deploy-federation`
9. `deploy`: deploy-clusters + deploy-federation
10. `destroy-federation`
11. `destroy-clusters`
12. `destroy`: destroy-federation + destroy-clusters
13. `redeploy-federation`: just redeploys the federation components.

2. Continue with `destroy` phase even in the face of errors.
1. Continue with `destroy` phase even in the face of errors.

The bash script sets `set -e errexit` which causes the script to exit
at the very first error. This should be the default mode for deploying
Expand Down