Skip to content

Commit c33e983

Browse files
authored
docs: add bash example (#16)
1 parent e55334e commit c33e983

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ Options for `project add`:
121121
- `-n, --name <name>`: Project name (required)
122122
- `-g, --github-orgs <githubOrgUrls...>`: GitHub organization URLs (optional)
123123

124+
## Scripting with visionBoard CLI
125+
126+
The visionBoard CLI can be incorporated into automation scripts for more complex workflows. Below is an example of how to chain multiple operations in a shell script.
127+
128+
The sample script ([sample.sh](sample.sh)) demonstrates how to:
129+
130+
1. Configure the CLI using environment variables
131+
2. Verify connectivity with the API
132+
3. List available resources for reference
133+
4. Set up a new project with GitHub integration
134+
5. Execute various workflows with and without parameters
135+
6. Perform bulk imports using both inline JSON and file-based input
136+
124137
## Configuration
125138

126139
The visionBoard CLI supports configuration through environment variables:

sample.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
3+
# Set environment variables for configuration
4+
export VISIONBOARD_INSTANCE_URL=http://localhost:3000
5+
6+
# Step 1: Verify environment and connectivity
7+
echo "=== Verifying environment and connectivity ==="
8+
visionboard version
9+
visionboard doctor
10+
11+
# Step 2: List available resources
12+
echo "\n=== Listing available resources ==="
13+
visionboard workflow list
14+
visionboard compliance-check list
15+
visionboard compliance-checklist list
16+
visionboard bulk-import list
17+
18+
# Step 3: Project setup
19+
echo "\n=== Setting up project ==="
20+
visionboard project add -n express -g https://github.com/expressjs
21+
22+
# Step 4: Execute workflows
23+
echo "\n=== Executing workflows ==="
24+
visionboard workflow execute -w update-github-orgs
25+
visionboard workflow execute -w run-all-checks
26+
27+
# Step 5: Execute workflow with inline JSON data
28+
echo "\n=== Executing workflow with inline JSON data ==="
29+
visionboard workflow execute -w run-one-check -d '{"check_name": "softwareArchitectureDocs"}'
30+
31+
# Step 6: Execute workflow with JSON data from file
32+
echo "\n=== Executing workflow with JSON data from file ==="
33+
cat > ./manual-check.json << EOF
34+
{
35+
"check_name": "softwareArchitectureDocs"
36+
}
37+
EOF
38+
visionboard workflow execute -w run-one-check -f ./manual-check.json
39+
40+
# Step 7: Bulk import with inline JSON data
41+
echo "\n=== Performing bulk import with inline JSON data ==="
42+
visionboard bulk-import run -i load-manual-checks -d '[
43+
{
44+
"type": "annualDependencyRefresh",
45+
"project_id": 1,
46+
"is_subscribed": true
47+
}
48+
]'
49+
50+
# Step 8: Bulk import with JSON data from file
51+
echo "\n=== Performing bulk import with JSON data from file ==="
52+
cat > ./import.json << EOF
53+
[
54+
{
55+
"type": "annualDependencyRefresh",
56+
"project_id": 1,
57+
"is_subscribed": true
58+
}
59+
]
60+
EOF
61+
visionboard bulk-import run -i load-manual-checks -f ./import.json
62+
63+
echo "\n=== Script execution completed ==="

0 commit comments

Comments
 (0)