Skip to content

shinnar/openwhisk-project

 
 

Repository files navigation

Build Status Dependencies

This project provides a set of tools for managing a collection of OpenWhisk entities and related services (eg. Cloudant, Redis, etc...).

Getting started

$ npm install openwhisk-deploy --save

Main Features

  • deploy: deploy a set of OpenWhisk entities and services from description stored in project configuration files.
  • undeploy: undeploy a set of managed OpenWhisk entities and managed services.
  • clean: remove all deployed entities in a namespace. Services are left untouched.
  • refresh: update the local deployment configuration files against deployed entities.
  • sync: update the local deployment configuration files against files stored locally.

Example

# try-catch combinator example
packages:
  plugin-combinator-1:
    actions:
      safeToDelete:
        kind: nodejs
        code: |
          function main(params) {
            if (params.delete)
              return {}
            throw new Error('Oh No!')
          } 
      delete:
        kind: nodejs
        code: |
          function main(params) {
            delete params[params.delete]
            return params
          }

      handleError:
        kind: nodejs
        code: |
          function main(params) {
            return {status: 'Um a very bad thing just happened - sorry?'}
          }
          
      trycatch:
        combinator: try safeToDelete catch handleError

      eca:
        combinator: if safeToDelete then delete

      forward:
        combinator: forward ["authkey"] after safeToDelete with ["delete"]
        inputs:
          authkey: very private
          delete: something

      retry:
        combinator: retry delete 5 times

Deployment format specification

See specification

Development

$ git clone https://github.com/lionelvillard/openwhisk-project.git
$ cd openwhisk-project
$ npm i

To run the tests, it is recommended to create the file .wskprops in the project root directory. Then do:

$ npm test

About

A tool for managing OpenWhisk project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 78.5%
  • JavaScript 20.1%
  • Shell 1.4%