Node Modules
Every pipeline node uses one built-in module. All modules share the Node name and Condition settings (see conditions); this page describes the module-specific settings.
Execute command
Runs a Shell command on one or more hosts; the most common node.
- Hosts: target hosts, multiple selection; hosts run in parallel.
- Command: the command to run.
_SPUG_*variables of parameter nodes and variables exported by build nodes are available.
The node fails as soon as the command exits with a non-zero code on any host.
Build
Pulls a Git repository on a host and runs a build command. The artifact stays in the workspace, usually followed by a Data transfer node that distributes it.
- Git repository:
http/httpsorsshURL; reachability is checked automatically after input. - Credential: for private repositories pick a credential from credential management (password credentials for
http/httpsURLs, key credentials forsshURLs); Add credential jumps to the credential page. - Branch / tag:
Branch+Latest commit: build the latest commit of the branch on every run;Branch+Select on run: a dialog asks for the commit ID at run time; leave it empty for the latest commit;Tag+Latest commit: build the newest tag;Tag+Select on run: choose one of the existing tags at run time.
- Build host: the host that runs the build; it needs
gitand the tool chain of the project. - Workspace: the checkout directory, e.g.
/data/build/myapp. - Build command: run inside the workspace, e.g.
npm ci && npm run build.
Variables exported in the build command as export SPUG_SET_<name>=<value> are passed to later nodes as <name>.
Parameter
Defines variables for the run and usually sits at the beginning of the flow.
- Dynamic parameters: asked from the user in a dialog when the pipeline runs. Each parameter has a name, a variable (becomes the environment variable
_SPUG_<variable>), a type (single-line text, multi-line text, password, date, single select, multi select), a required flag, a default value and a help text. Select types need options, one per line, optionallyvalue:label; multi-select values are joined with commas. - Static parameters: fixed variable names and values that become global variables, for constants shared by several nodes.
Data transfer
Syncs a file or directory from one host to one or more target hosts, implemented with sshfs + rsync.
- Source path / Source host: the host and path of the file or directory; a directory source syncs all of its files into the target path.
- Target path / Target hosts: for a file source, a target path ending with
/places the file inside that directory (creating or overwriting a file with the same name); otherwise the target path is the resulting file path (effectively renaming the file).
The transfer mounts with sshfs and runs rsync on the host (or container) running Spug, so both must be installed there and Docker needs privileged: true; target hosts need rsync.
Data upload
The operator uploads files from the browser when the pipeline runs, and the files are distributed to the target hosts. Useful for packages built by an external system.
- Target hosts: where the files are uploaded to, multiple selection.
- Upload path (directory): a directory on the target hosts; files with the same name are overwritten.
- File type limit: optional, e.g.
.jar,.zip. - File size limit: optional, in MB.
DingTalk / Feishu / WeCom push
Sends the pipeline result through a group bot webhook; the three modules are configured the same way.
- Bot webhook URL: from the bot settings of the group, must start with
http://orhttps://. - Signing secret (DingTalk / Feishu): fill in when the bot uses
Signing(DingTalk) orSignature verification(Feishu), otherwise leave empty. - Title / Content: markdown is supported;
$SPUG_PIPE_NAME(pipeline),$SPUG_NODE_NAME(node),$SPUG_STATE_TEXT(upstream state: succeeded / failed),$SPUG_DATETIME(current time) and the variables of parameter nodes can be used. - @all: DingTalk appends
@allto the text; Feishu mentions everyone inside the card; WeCom markdown cannot mention, so an extra reminder message is sent.
Feishu cards automatically use a green or red header depending on the upstream result.
Set the condition of push nodes to Always or On upstream failure so that you are notified when the flow fails. For DingTalk bot security settings see DingTalk does not receive notifications.
Push Assistant
Sends SMS, phone call, email or WeChat official account messages through Push Assistant.
- Bind a Push Assistant account under
System / Settings / Push Servicefirst and add contacts in Push Assistant. - Recipients: contacts of the bound Push Assistant account, grouped by SMS, phone, email and WeChat official account.
- Title / Content: the same variables as the webhook push modules are available.
SMS and phone channels of Push Assistant are billed per message; the balance is shown on the Push Service settings page.