From 8e59f211f3221fac43de3dcc9fed5b826b85273b Mon Sep 17 00:00:00 2001 From: amottier Date: Wed, 26 Jun 2019 11:27:35 +0200 Subject: [PATCH] SRVLESS-165_remove_stage_feature --- deploy/lib/createNamespace.js | 2 +- docs/README.md | 15 --------------- package.json | 2 +- provider/scalewayProvider.js | 1 - remove/lib/removeNamespace.js | 2 +- shared/namespace.js | 2 +- shared/setUpDeployment.js | 3 --- 7 files changed, 4 insertions(+), 23 deletions(-) diff --git a/deploy/lib/createNamespace.js b/deploy/lib/createNamespace.js index 3d656803..1917e56c 100644 --- a/deploy/lib/createNamespace.js +++ b/deploy/lib/createNamespace.js @@ -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, }; diff --git a/docs/README.md b/docs/README.md index 4ba4976b..c2d68f00 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 @@ -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 diff --git a/package.json b/package.json index 28fbe4f4..05206525 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/provider/scalewayProvider.js b/provider/scalewayProvider.js index f026f625..f42daf9a 100644 --- a/provider/scalewayProvider.js +++ b/provider/scalewayProvider.js @@ -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: { diff --git a/remove/lib/removeNamespace.js b/remove/lib/removeNamespace.js index a99a3882..e1bcca8e 100644 --- a/remove/lib/removeNamespace.js +++ b/remove/lib/removeNamespace.js @@ -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) => { diff --git a/shared/namespace.js b/shared/namespace.js index f120727d..4a7ee186 100644 --- a/shared/namespace.js +++ b/shared/namespace.js @@ -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); }); }, }; diff --git a/shared/setUpDeployment.js b/shared/setUpDeployment.js index b2d489bb..522c3b9d 100644 --- a/shared/setUpDeployment.js +++ b/shared/setUpDeployment.js @@ -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; }, };