Skip to content

Commit 8bec05a

Browse files
authored
Add quick-start docs (#84)
1 parent 5fb1a0f commit 8bec05a

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

README.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
1-
# Serverless Framework: Deploy on Scaleway Functions
1+
# Scaleway Plugin for Serverless Framework
22

3-
The Scaleway functions plugin for [Serverless Framework](https://serverless.com/) allows users to deploy their functions and containers to Scaleway Functions with a simple `serverless deploy`.
3+
This is the [Scaleway Functions](https://www.scaleway.com/en/serverless-functions/) plugin for [Serverless Framework](https://serverless.com/).
44

5-
Serverless Framework handles everything from creating namespaces to function/code deployment by calling APIs endpoint under the hood.
5+
## Quick-start
6+
7+
0. Install the [Serverless Framework](https://www.serverless.com/framework/docs/getting-started).
8+
1. Create a Scaleway account, and log in to the [Scaleway Console](https://console.scaleway.com/login).
9+
2. Generate an [API key](https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/).
10+
3. Set up the [Scaleway CLI](https://www.scaleway.com/en/cli/).
11+
4. Generate and invoke your function:
12+
13+
```shell
14+
# Available templates: https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples
15+
export TEMPLATE=python3
16+
17+
# Create the function
18+
serverless create --path my-func --template-url https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/${TEMPLATE}
19+
20+
# Install deps
21+
cd my-func
22+
npm i
23+
24+
# Deploy - note the URL that is returned in the deploy step
25+
serverless deploy
26+
27+
# Invoke
28+
serverless invoke --function first
29+
```
30+
31+
## Contents
32+
33+
Serverless Framework handles everything from creating namespaces to function/code deployment by calling APIs endpoint under the hood.
634

735
- [Serverless Framework: Deploy on Scaleway Functions](#serverless-framework-deploy-on-scaleway-functions)
836
- [Requirements](#requirements)
@@ -24,7 +52,7 @@ Serverless Framework handles everything from creating namespaces to function/cod
2452
- [License](#license)
2553

2654
## Requirements
27-
55+
2856
- Install node.js
2957
- Install [Serverless](https://serverless.com) CLI (`npm install serverless -g`)
3058

@@ -76,7 +104,7 @@ provider:
76104

77105
plugins:
78106
- serverless-scaleway-functions
79-
107+
80108
package:
81109
patterns:
82110
- '!node_modules/**'
@@ -237,7 +265,7 @@ functions:
237265
```
238266

239267
### Golang
240-
268+
241269
Path to your handler's **package**, for example if I have the following structure:
242270
```yml
243271
- src
@@ -349,7 +377,7 @@ custom:
349377
mycontainer:
350378
directory: my-container-directory
351379
# port: 8080
352-
# Environment only available in this container
380+
# Environment only available in this container
353381
env:
354382
MY_VARIABLE: "my-value"
355383
```
@@ -371,7 +399,7 @@ Here is an example of the files you should have, the `directory` containing your
371399
└── serverless.yml
372400
```
373401
374-
Scaleway's platform will automatically inject a PORT environment variable on which your server should be listening for incoming traffic. By default, this PORT is 8080. You may change the `port` in your `serverless.yml`.
402+
Scaleway's platform will automatically inject a PORT environment variable on which your server should be listening for incoming traffic. By default, this PORT is 8080. You may change the `port` in your `serverless.yml`.
375403
376404
You may use the [container example](https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/container) to getting started.
377405

examples/python3/serverless.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ provider:
66
# Global Environment variables - used in every functions
77
env:
88
test: test
9-
# the path to the credentials file needs to be absolute
10-
scwToken: <scw-token>
11-
scwProject: <scw-project-id>
12-
# region in which the deployment will happen
13-
scwRegion: fr-par
149

1510
plugins:
1611
- serverless-scaleway-functions

0 commit comments

Comments
 (0)