This repository is a Typescript & Javascript skeleton with Vue, designed for quickly getting started developing a web application. Check the Getting Started for full details.
I have created two services for docker-compose. First one, named local, will generate docker image from current repo's state.
docker-compose up local
The second one will pull from Artifact Registry the Docker's Image
docker-compose up pro
In order to keep tf-state remote using GCP, we need to create an Bucket where we will save tfstate
gsutil mb gs://${PROJECT_ID}-tfstate
gsutil versioning set on gs://${PROJECT_ID}-tfstate
The we initialize backend using this bucket
backend "gcs" {
bucket = "${PROJECT_ID}-tfstate"
prefix = "state"
}
Commands to genereate the solution via Terraform:
terraform init
terraform plan
terraform apply
If you want to deploy K8S resources via Teraform, you should replace ci/cloud-build.yaml to lines with #. POD will be failing until you generate first version of Docker Image
Each time you generate and push a new tag, CloudBuild will creates a new docker image with that tag and replace it on YAML's POD resource.
Notice that you should approve it before CloudBuild starts (it could be setted to false in 030_cloid_service_trigger tf file)