-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README has been extended with commands
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
# SummingMicroservice | ||
A Go microservice that computes and returns the sum of two numbers. | ||
|
||
Before using GCloud-specific targets, export the following environment variables: | ||
- export ENVIRONMENT=staging | ||
- export GCP_PROJECT_ID=*\<YOUR GCP PROJECT ID\>* | ||
### **Commands of local use (dev version):** | ||
``` | ||
make build | ||
make run | ||
curl "127.0.0.1:8081/sum?a=1&b=4" # For testing | ||
google-chrome "127.0.0.1:8081/sum?a=1&b=4" # For testing | ||
``` | ||
|
||
### **Commands of local Docker use (dev version):** | ||
``` | ||
make local-docker-build | ||
make local-docker-run | ||
curl "0.0.0.0:8081/sum?a=1&b=4" # For testing | ||
google-chrome "0.0.0.0:8081/sum?a=1&b=4" # For testing | ||
``` | ||
|
||
### **Commands of GCloud use (staging version):** | ||
``` | ||
export ENVIRONMENT=staging | ||
export GCP_PROJECT_ID=<YOUR GCP PROJECT ID> # Replace the <YOUR GCP PROJECT ID> !!! | ||
make gcloud-docker-init # This only needs to be run once ! | ||
make gcloud-docker-build | ||
make gcloud-docker-push # This pushes the docker image into the GCloud's Container Registry | ||
make gcloud-run-deploy # This deployes the pushed docker image into the GCloud's Cloud Run | ||
google-chrome "https://<LINK PROVIDED BY GCLOUD'S CLOUD RUN>/sum?a=1&b=4" # For testing | ||
``` | ||
|
||
### **Commands of GCloud use (production version):** | ||
``` | ||
git push origin main # This delivers the changes to GitHub main and the GitHub Actions builds, pushes and deployes it to GCloud. | ||
google-chrome "https://<LINK PROVIDED BY GCLOUD'S CLOUD RUN>/sum?a=1&b=4" # For testing | ||
``` | ||
|
||
Based on https://github.com/SanFranciscobolJottem/penguin-api |