Skip to main content
Version: 4.x

Orchestration and Execution

Overview

Pipelines are new in 4.0. They let you arrange the built-in modules parameter, build, execute command, data transfer, data upload and message push as nodes of a workflow, run it with one click and follow every node and host in a live console. Compared with the fixed flow of application deployment, pipelines are a better fit for:

  • multi-step, multi-host release and operations flows with dependencies between steps;
  • flows that need input from the operator at run time (version, branch, feature switches);
  • artifacts that must be distributed to many hosts followed by further commands;
  • results that should be pushed to DingTalk / Feishu / WeCom, or sent as SMS / phone calls through Push Assistant.

Pipeline editor

Creating a pipeline

  1. Click New on the Pipelines page, enter a name and open the editor.
  2. The canvas is on the left. Click a node to open the Select Module / Module Config panel on the right; the menu of a node lets you add a downstream node or delete the node.
  3. Pick a built-in module for every node, fill in its settings and click Save.
  4. Click the Run button (lightning icon) in the top-right corner; the list page also has a Run action.

Select module

Nodes and conditions

Execution starts at the first node. Every node finishes as success or failure, and the condition of each downstream node decides whether it runs:

ConditionDescription
On upstream successruns only after the upstream node succeeded (default)
On upstream failureruns only when the upstream node failed; typical for failure notifications or rollbacks
Alwaysruns regardless of the upstream result; typical for clean-up and result notifications
  • The first node has no upstream, so its condition is ignored.
  • A node may have several downstream nodes; all that match the condition run in parallel. Give each node only one upstream to avoid triggering it twice.
  • Multi-host nodes (execute command, data transfer, data upload) run on the selected hosts in parallel and succeed only when every host succeeds.

Node configuration

Running and the console

When a pipeline contains a parameter node with dynamic parameters, a build node with a Git branch / tag chosen at run time, or a data upload node, a dialog asks for the values or files before the run starts.

Pipeline console

  • The left side lists every node with its state (waiting, running, succeeded, failed); click a node to see the real-time output of each host.
  • Running nodes can be terminated, which sends a termination signal to the hosts.
  • Every run is stored as a history entry with an increasing sequence number.

Variables

Variables are injected into node scripts as environment variables:

SourceVariableDescription
Parameter node_SPUG_<variable>dynamic parameters (entered at run time) and static parameters (fixed values)
Build nodeSPUG_SET_*variables exported in the build command with the SPUG_SET_ prefix are passed to later nodes without the prefix
Build node_spug_git_tag / _spug_git_committhe Git tag / commit chosen at run time
Push nodes$SPUG_PIPE_NAME, $SPUG_NODE_NAME, $SPUG_STATE_TEXT, $SPUG_DATETIMEpipeline name, node name, upstream state text and current time, available in push content only

Example: export a version number in the build node for later command nodes:

# build command of the build node
mvn -q package
export SPUG_SET_JAR_VERSION=$(cat VERSION)
# a later execute command node
java -jar app-$JAR_VERSION.jar

See Node modules for the settings of every module.

Permissions

Pipeline permissions are under Roles / Feature permissions / Pipelines (view, new, edit, delete, run). The hosts selectable in nodes follow the host permissions of the role.