Emblem Giving is a sample application intended to demonstrate a complex, end-to-end serverless architecture. It showcases serverless continuous delivery as a donation sample app hosted on Google Cloud.
This sample application is for learning purposes only. Real financial transactions are not made. The giving campaigns in the app are not real.
This project features:
Go deeper into project details in the documentation or read through the technical decisions that got us where we are today.
Emblem is made of a combination of resources created and managed by Terraform and resources created via the Google Cloud CLI or Google Cloud Console. You may deploy Emblem by running setup.sh
(see streamlined setup instructions).
To deploy Emblem, you will need:
The machine that you will run the setup from will need the following installed:
We recommend running through setup steps using Google Cloud Shell, which has the required softare pre-installed. The following will open Cloud Shell Editor and clone this repo:
Connect a fork of this Github repo to your Emblem ops project
Connect your repository to your Google Cloud Project via the Cloud Build triggers page in the Google Cloud Console. Make sure you are working from your ops project and make sure you select region "Global (non-regional)" when connecting your repo. This will require you to enable the Cloud Build API and authenticate with your Github account.
gcloud services enable cloudbuild.googleapis.com
Principals with access to your Google Cloud project will be able to create and run triggers on the repository you use.
Set environment variables
The streamlined setup uses setup.sh
to deploy Emblem resources via Terraform and the gcloud
CLI.
Create three environment variables (PROD_PROJECT, STAGE_PROJECT, OPS_PROJECT) with their respective project id's.
export PROD_PROJECT=<YOUR_PROD_PROJECT_ID>
export STAGE_PROJECT=<YOUR_STAGE_PROJECT_ID>
export OPS_PROJECT=<YOUR_OPS_PROJECT_ID>
Execute setup.sh
The setup will do the following:
terraform apply
from each of the environment root directories in terraform/environments/
content-api
, web
, and runner
containers to the Artifact Registry repositories in your ops projectcontent-api
and website
in your stage and prod projectsYou will be prompted to enter the URL for the Github repository you added to your ops project in step 1. This will be used to deploy Cloud Build triggers for the CICD pipeline. To begin setup:
./setup.sh
Once complete you will have a deployed instance of Emblem.
To see which Google services and apis got installed in your projects, check out below:
stateDiagram
Operations --> Staging
Operations --> Production
state Operations {
state "IAM" as a0
state "Secret Manager" as a1
state "Cloud Build" as a2
state "Artifact Registry" as a3
state "Cloud Firestore" as a4
state "Cloud Scheduler" as a5
state "Pub/Sub" as a6
}
state Staging {
direction LR
state "Cloud Firestore" as b0
state "Cloud Storage" as b1
state "Cloud Run" as b2
state "Cloud Logging" as b3
}
state Production {
direction LR
state "Cloud Firestore" as c0
state "Cloud Storage" as c1
state "Cloud Run" as c2
state "Cloud Logging" as c3
}
This is not an official Google project.