This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build and push the docker image, then deploy a new release of the Cloud Run service | |
.PHONY: api.deploy | |
api.deploy: | |
docker build . -t $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION) | |
docker push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION) | |
gcloud --project $(GCLOUD_PROJECT) run deploy $(GCLOUD_SERVICE) --image $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION) --region $(GCLOUD_REGION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "google" { | |
project = var.gcp_project | |
region = var.gcp_region | |
credentials = file(var.gcp_auth_file) | |
} | |
data "google_project" "project" { | |
} | |
# Docker image registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If there is a .env file, create a temporary copy of it, in a format supported by Makefile | |
# where every variable become a fallback. "FOO=bar" becomes "FOO?=bar" | |
ifneq (,$(wildcard ./.env)) | |
DOTENV_PATH=/tmp/$(shell echo $$(pwd) | base64) | |
include $(shell cat .env | grep -v --perl-regexp '^('$$(env | sed 's/=.*//'g | tr '\n' '|')')\=' | sed 's/=/?=/g' > $(DOTENV_PATH); echo '$(DOTENV_PATH)') | |
endif | |
# Expose all defined variables to subprocesses. | |
export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: docker:17.06.0-ce-git | |
steps: | |
- checkout | |
- setup_remote_docker | |
- run: | |
name: Install Docker Compose |