https://github.com/mrdulin/serverless-functions-go
Better serverless architecture for deploying easily using Cloud Run, Cloud Functions, GKE, even a web server
https://github.com/mrdulin/serverless-functions-go
architecture clean-architecture cloud cloud-functions cloud-run go golang google-adwords serverless serverless-functions
Last synced: 5 months ago
JSON representation
Better serverless architecture for deploying easily using Cloud Run, Cloud Functions, GKE, even a web server
- Host: GitHub
- URL: https://github.com/mrdulin/serverless-functions-go
- Owner: mrdulin
- Created: 2019-08-13T04:32:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-21T14:22:35.000Z (over 6 years ago)
- Last Synced: 2025-08-30T10:36:07.959Z (7 months ago)
- Topics: architecture, clean-architecture, cloud, cloud-functions, cloud-run, go, golang, google-adwords, serverless, serverless-functions
- Language: Go
- Size: 82 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# serverless-functions-go
## Deploy
### Deploy on Cloud Run
1. Build docker image using `Dockerfile.cloudrun` file
```bash
docker build -f Dockerfile.cloudrun -t sls-fn-go .
```
2. Push the docker image to docker registry
For example, using `GCR`
```bash
docker tag sls-fns-go gcr.io/${projectId}/sls-fns-go
```
```bash
docker push gcr.io/${projectId}/sls-fns-go
```
3. Deploy using `gcloud` sdk
Make sure the version of `gcloud` sdk is `251.0.0`, it seems there is an issue about latest version(`253.0.0`) when deploy resource on cloud run
```bash
gcloud components update --version 251.0.0
```
deploy shell script [here](./scripts/cloud-run/deploy.sh)
### Deploy as Cloud Functions
`cd` to the root directory of the cloud function, for example:
```bash
cd ./infrastructure/functions/getAdPerformanceReport
```
Run `./deploy.sh` script:
```bash
./deploy.sh
```