Skip to content

Commit

Permalink
README has been extended with commands
Browse files Browse the repository at this point in the history
  • Loading branch information
slali87 committed Jul 16, 2024
1 parent 579a428 commit 9370d16
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local-docker-build:
docker build -t $(TAG) .

local-docker-run:
docker run --rm $(TAG)
docker run --rm -p 8081:80 $(TAG)

# GCloud-specific targets
TAG_GCLOUD = gcr.io/$(GCP_PROJECT_ID)/$(APP_LOWER_CASE):$(ENVIRONMENT)
Expand Down
35 changes: 32 additions & 3 deletions README.md
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

0 comments on commit 9370d16

Please sign in to comment.