-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary-workflow.sh
More file actions
executable file
·55 lines (48 loc) · 1.88 KB
/
Copy pathlibrary-workflow.sh
File metadata and controls
executable file
·55 lines (48 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
set -euo pipefail
# Shared Workflow Library Demo
#
# Demonstrates Mantle's shared workflow library for publishing, discovering,
# and deploying reusable workflow templates across teams.
#
# Prerequisites:
# - Mantle binary built (make build)
# - Postgres running (docker compose up -d)
# - Migrations applied (./mantle init)
# - At least one workflow applied (e.g., ./mantle apply examples/hello-world.yaml)
#
# This is a demonstration script — it requires a running database to execute.
MANTLE="./mantle"
echo "==> Publishing workflows as library templates..."
echo ""
echo "Publish a workflow so other teams can discover and reuse it."
$MANTLE library publish --workflow hello-world
$MANTLE library publish --workflow scheduled-health-check
echo ""
echo "==> Listing available templates..."
echo ""
echo "Any team can browse the shared library."
$MANTLE library list
echo ""
echo "==> Deploying a template to a team..."
echo ""
echo "Deploy a library template into a team's workspace. The team gets"
echo "their own copy that they can customize."
$MANTLE library deploy --template hello-world --team engineering
$MANTLE library deploy --template scheduled-health-check --team data-science
echo ""
echo "==> Verifying deployed workflows..."
$MANTLE validate examples/hello-world.yaml
$MANTLE validate examples/scheduled-health-check.yaml
echo ""
echo "========================================"
echo " Shared library demo complete!"
echo "========================================"
echo ""
echo "Library workflow:"
echo ""
echo " 1. Author a workflow and apply it: ./mantle apply my-workflow.yaml"
echo " 2. Publish it to the shared library: ./mantle library publish --workflow my-workflow"
echo " 3. Other teams discover it: ./mantle library list"
echo " 4. Teams deploy their own copy: ./mantle library deploy --template my-workflow --team my-team"
echo ""