You need all the tools below installed locally:
- make
- Java
- Leiningen (can be installed using
brew install leiningen
)
- make
- docker daemon
- terraform
- ssh-keygen
- gcloud cli
This is a multi-step guide to setup some base infrastructure, and then, on top of it, the test environment for the newsfeed application.
With an assumption that we have a new, empty GCP account, we need to provision some base infrastructure just one time. These steps will provision:
- terraform backend in GCS bucket
- a minimal VPC with 1 subnet
- GCR repositories for docker images
If you haven't built the jars and static resources yet, you should do so now:
make _apps
Artifacts from previous stage will be packaged into docker images, then pushed to ECR.
Each application has its own image. Individual image can be built with:
make <app-name>.docker
# for example:
make front-end.docker
But you can build all images at once with
make docker
Before applications can be deployed on GCP, the docker images have to be pushed:
make _push
Then, we can provision the backend and front-end services:
make _news.infra
Terraform will print the output with URL of the front_end server, e.g.
Outputs:
frontend_url = http://34.244.219.156:8080
To delete the deployment provisioned by terraform, run following commands:
make _news.deinfra