https://github.com/leopardslab/nodecloud-gcp-plugin
🔧 NodeCloud GCP plugin
https://github.com/leopardslab/nodecloud-gcp-plugin
gcp nodejs
Last synced: 11 months ago
JSON representation
🔧 NodeCloud GCP plugin
- Host: GitHub
- URL: https://github.com/leopardslab/nodecloud-gcp-plugin
- Owner: leopardslab
- License: mit
- Created: 2018-04-26T16:40:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-22T16:40:46.000Z (about 4 years ago)
- Last Synced: 2023-03-04T00:18:50.229Z (over 3 years ago)
- Topics: gcp, nodejs
- Language: JavaScript
- Homepage:
- Size: 178 KB
- Stars: 43
- Watchers: 6
- Forks: 42
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nodecloud-gcp-plugin
Google Cloud plugin for [nodecloud](https://github.com/cloudlibz/nodecloud)
## 🚀 Install
```
$ npm install nodecloud-gcp-plugin
OR
$ yarn add nodecloud-gcp-plugin
```
## ✌️ How to setup
- Download keyFile from GCP console
- Set environment variables
```
GCLOUD_PROJECT='nodecloud-demo',
GCLOUD_KEY_FILE_NAME='xxxxxxxxxxx'
```
Use same key names as they are used in this plugin implementation.
Make sure you have `.nc.config` file in the project root and have `nodecloud-core` installed.
Content of `.nc.config` file is assumed as the following json structure.
It is an array of supported providers.
1. `name` : Provider name which nodecloud supports.
2. `tag` : Name that you will use to load the given provider. It is for your reference in code. It can be anything that you may like.
3. `libName` : Library name which has to be installed before loading a provider.
Config file can contain array of objects for all providers and all will be loaded.
Supported values for `name` : azure, google, aws
```js
const providers = [
{
name: 'google',
tag: 'google',
libName: 'nodecloud-gcp-plugin',
configFile: {
projectId: "YOUR_GCLOUD_PROJECT_ID",
keyFilename: "ABSOLUTE_PATH_TO_SERVICE_KEY"
}
},
// other providers might be included here
]
module.exports = providers;
```
Here is how to obtain a service [key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys).
Remember that you need to give this service account appropiate roles!
## 💻 Development
```
$ git clone https://github.com/cloudliz/nodecloud-gcp-plugin
$ cd nodecloud-gcp-plugin
$ npm link
$ cd .. && mkdir nodecloud-dev && cd nodecloud-dev
$ npm link nodecloud-gcp-plugin
$ cd .. && git clone https://github.com/cloudliz/nodecloud
$ cd nodecloud
$ npm link
$ cd nodecloud-dev
$ npm link nodecloud
```