As developers, we want to be able to deploy a test version of the application for adding a new feature, testing or debugging. This guide covers how to deploy your own version of XplorersBot to Google Cloud.
Terraform workspaces allow multiple instances of infrastructure to be provisioned from the same Terraform configuration. Using workspaces, you can maintain different environments like dev
, staging
and production
from the same code base.
Run the following commands to create and switch to a dev
workspace:
terraform -chdir=terraform workspace new dev
terraform -chdir=terraform workspace select dev
Create a secret with name slack-oauth-token-dev
to store your slack token to be used by your feature branch based deployment where dev
refers to the terraform workspace name.
If you are testing the function locally, set the environment variable SLACK_OAUTH_TOKEN
instead before running task run-cloudfunctions-framework
.
Run the following commands to check the deployment plan and to deploy your feature branch to the dev
workspace:
task terraform-plan
task terraform-apply