0.1.1 • Published 4 years ago
buildci-plugin-aws v0.1.1
BuildCI Plugin Example
A simple BuildCI plugin example.
Hello World plugin example
To create a plugin enter a new directory and enter:
buildci plugin create
This will create an example plugin in the new directory. Open index.ts
in the src
directory.
In the file add:
import { CommandOption, Command, Plugin, utils, libBuildCI, Settings } from "libbuildci";
export async function main (settings: Settings, jsonSettings: any): Promise<any>
{
let newPlugin = new Plugin ("new-plugin", "1.0.0");
newPlugin.pluginCommand = new Command ("new-plugin-commands", "The new plugin commands.");
let newCommand: Command = new Command ("hello-world", "The hello world command.",
async function (): Promise<string>
{
return ("Hello World!");
});
newPlugin.addCommand (newCommand);
return (newPlugin);
}
Save the file and run the build command by entering:
npm run build
Install the new plugin into buildci by doing:
buildci plugin install .
If you're using Linux, you may have to run this command as root or use sudo.