You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Setup you serverless environment to work with GCP by working you way through the Serverless Framework [GCP guides](https://www.serverless.com/framework/docs/providers/google/guide/intro/)
7
+
- You have the [Serverless Framework](https://www.serverless.com/framework/docs/getting-started/) installed.
8
+
- You have a project already created and configured in Google Cloud. You can follow [this guide](https://www.serverless.com/framework/docs/providers/google/guide/credentials/) to make sure its setup to work with Severless.
9
+
- You've setup your overall environment to work with GCP and the Serverless Framework. You should follow [these guides](https://www.serverless.com/framework/docs/providers/google/guide/intro/) if not.
9
10
10
-
## Usage
11
+
## Project structure
11
12
12
-
Create a new service for each logical microservice you intend to deploy.
13
+
The root directory contains a folder for each of your microservices (i.e. Go package).
13
14
14
-
Each microservice could be made up of a single or several cloud functions.
15
+
The `go.mod` file also resides in the root directory.
15
16
16
-
### Create a new service
17
+
##Start a new project from the template
17
18
18
-
Use the `serverless create` command to download the template into a new project folder:
19
+
1. Clone the template repo into a new local project folder:
2. Update `go.mod` with your module name. For example:
33
+
## Create a new micoservice/package
34
+
35
+
Create a directory (i.e. package) for each logical microservice you intend to deploy. Each microservice could be made up of a single or several cloud functions.
36
+
37
+
### TL;DR:
38
+
39
+
1. From the root directory, make a copy of the `templateservice` directory and rename it to match your microservice/package name:
5. Take a look at [this guide](https://cloud.google.com/functions/docs/writing#structuring_source_code) for ideas on how to structure your source code for different scenarios:
87
+
### Additional info
88
+
89
+
Take a look at [this guide](https://cloud.google.com/functions/docs/writing#structuring_source_code) for ideas on how to structure your source code for different scenarios:
77
90
78
91
## Deploy
79
92
80
-
Run the following command from your service directory to build and deploy all functions:
93
+
Run the following command from within your microservice/package directory to build and deploy all functions:
81
94
82
95
<pre>
83
96
cd <b>mynewservice</b> && serverless deploy
84
97
</pre>
85
98
86
99
## Remove Deployment
87
100
88
-
Run the following command from your service directory to remove the deployment of all functions:
101
+
Run the following command from within your microservice/package directory to remove the deployment of all functions:
0 commit comments