Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/lib/createNamespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {

this.serverless.cli.log('Creating namespace...');
const params = {
name: this.namespaceFullName,
name: this.namespaceName,
organization_id: this.provider.getScwOrganization(),
environment_variables: this.namespaceVariables,
};
Expand Down
15 changes: 0 additions & 15 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ service:

provider:
name: scaleway
# stage where you want to deploy your functions, defaults to dev
stage: production
# Available Runtimes are:
# node8, node10 for JavaScript
# python (2.7), python3 (3.7) for Python
Expand Down Expand Up @@ -209,19 +207,6 @@ functions:
LOCAL_VARIABLE: mounted-in-this-function
```

### Stage

In order to make it easy for organizations to deploy their functions to multiple environments, we provide a way to `tag` your namespaces with a **stage**.

**By default**, stage value => `dev`

This way, you may deploy to a different environment by inquiring a `stage`:

- **serverless.yml**:
```yml
provider:
stage: staging
```

# Serverless Remove: Delete a project

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-scaleway-functions",
"version": "0.1.0",
"version": "0.1.3",
"description": "Provider plugin for the Serverless Framework v1.x which adds support for Scaleway Functions.",
"main": "index.js",
"author": "scaleway.com",
Expand Down
1 change: 0 additions & 1 deletion provider/scalewayProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ScalewayProvider {
this.setCredentials(options);

this.apiUrl = 'https://api.scaleway.com/functions/v1alpha2/regions/fr-par';
this.defaultStage = 'dev';
this.apiManager = axios.create({
baseURL: this.apiUrl,
headers: {
Expand Down
2 changes: 1 addition & 1 deletion remove/lib/removeNamespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},

removeSingleNamespace(namespace) {
if (!namespace) throw new Error(`Unable to remove namespace and functions: No namespace found with name ${this.namespaceFullName}`);
if (!namespace) throw new Error(`Unable to remove namespace and functions: No namespace found with name ${this.namespaceName}`);
return this.provider.apiManager.delete(`namespaces/${namespace.id}`)
.then(() => this.waitNamespaceIsDeleted(namespace))
.catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion shared/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
return this.provider.apiManager.get('namespaces')
.then((response) => {
const namespaces = response.data.namespaces;
return namespaces.find(ns => ns.name === this.namespaceFullName);
return namespaces.find(ns => ns.name === this.namespaceName);
});
},
};
3 changes: 0 additions & 3 deletions shared/setUpDeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ module.exports = {
const provider = service.provider;
this.namespaceName = service.service;
this.namespaceVariables = provider.env || {};
// If no stage provided -> use `dev` one
this.stage = provider.stage || this.provider.defaultStage;
this.namespaceFullName = `${this.namespaceName}-${this.stage}`;
this.runtime = provider.runtime;
},
};