Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ert78gb/gcf-deploy
Google Cloud function deploy wrapper
https://github.com/ert78gb/gcf-deploy
Last synced: 13 days ago
JSON representation
Google Cloud function deploy wrapper
- Host: GitHub
- URL: https://github.com/ert78gb/gcf-deploy
- Owner: ert78gb
- Created: 2017-10-23T12:11:51.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-24T17:44:34.000Z (about 7 years ago)
- Last Synced: 2024-12-03T17:07:30.727Z (20 days ago)
- Language: TypeScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
Google Cloud Functions deploy wrapper
=====================================This is a small library that helps to deploy Google Functions without installing Google SDK.
The main goal is to support deployment with binary dependencies.**!!! Important !!!** I have created the tool in a hurry so it does not contain all functionality supported by [API](https://cloud.google.com/functions/docs/reference/rest/v1beta2/projects.locations.functions)
As soon as I need these features I will implement them and add more unit tests :)The tool works with the following steps:
- copy all deployment files in one directory
- zip all files
- create a storage bucket if not exist
- upload the zip file
- create or update functions## How to use
```javascript
const deploy = require('gcf-deploy');const deployOption = {
credentials: path.resolve(__dirname, './google-credential.json'), // absolute path of the google credential file
projectId: 'project-id', // Google Cloud project ID where the function will be deployed
globs: [ // which files should be deployed
'node_modules/**', // the whole node_modules except dev dependencies.
'src/**/!(*.spec).js' // all files in src folder except spec files
],
bucket: 'bucket-name', // which bucket should contains the zip files
func: {
entryPoint: 'helloWorld', // entry point of the function
description: 'gcf-deploy sample function', // description of the function
timeout: '15s', // running timeout
availableMemoryMb: 128 // max available memory to the function
},
overwrite: true // overwrite the deployment file if that exists in the bucket
};deploy(deployOption)
.then(result=>{
// do something
})
.catch(error=>{
// ooh error :(
});
```## Related to
- https://github.com/serverless/serverless-google-cloudfunctions