cli

command module
v0.1.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

Actions CLI

Build Status

The Actions CLI allows you to setup Actions on your local dev machine or on a Kubernetes cluster, provides debugging support, launches and manages Actions instances.

Setup

  • Download the release for your OS
  • Unpack it
  • Move it to your desired location (for Mac/Linux - mv actions /usr/local/bin. For Windows, add the executable to your System PATH.)

Note: For Windows users, run the cmd terminal in administrator mode

Note: For Linux users, if you run docker cmds with sudo, yuu need to use "sudo actions init

Usage
Install Actions

To setup Actions on your local machine:

Note: For Windows users, run the cmd terminal in administrator mode

$ actions init
⌛  Making the jump to hyperspace...
▇   Downloading binaries and setting up components...
✅  Success! Actions is up and running

To setup Actions on Kubernetes:

$ actions init --kubernetes
⌛  Making the jump to hyperspace...
▇   Deploying the Actions Operator to your cluster...
✅  Success! Actions is up and running

Note: The init command will install the latest stable version of Actions on your cluster. For more advanced use cases, please use our Helm Chart.

Launch Actions and your app

The Actions CLI lets you debug easily by launching both Actions and your app. Logs from both the Actions Runtime and your app will be displayed in real time!

Example of launching Actions with a node app:

$ actions run --app-id nodeapp node app.js

Example of launching Actions with a node app listening on port 3000:

$ actions run --app-id nodeapp --app-port 3000 node app.js

Example of launching Actions on port 6000:

$ actions run --app-id nodeapp --app-port 3000 --port 6000 node app.js
Publish/Subscribe

To use pub-sub with your app, make sure that your app has a POST HTTP endpoint with some name, say myevent. This sample assumes your app is listening on port 3000.

Launch Actions and your app:

$ actions run --app-id nodeapp --app-port 3000 node app.js

Publish a message:

$ actions publish --app-id nodeapp --topic myevent

Publish a message with a payload:

$ actions publish --app-id nodeapp --topic myevent --payload '{ "name": "yoda" }'
Invoking

To test your endpoints with Actions, simply expose any POST HTTP endpoint. For this sample, we'll assume a node app listening on port 300 with a /mymethod endpoint.

Launch Actions and your app:

$ actions run --app-id nodeapp --app-port 3000 node app.js

Invoke your app:

$ actions send --app-id nodeapp --method mymethod
List

To list all Actions instances running on your machine:

$ actions list

To list all Actions instances running in a Kubernetes cluster:

$ actions list --kubernetes

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
age
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL