-
Notifications
You must be signed in to change notification settings - Fork 7
/
tasks.yaml
151 lines (125 loc) · 4.77 KB
/
tasks.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
includes:
- setup: ./tasks/setup.yaml
- create: ./tasks/create.yaml
- deploy: ./tasks/deploy.yaml
- lint: ./tasks/lint.yaml
- publish: ./tasks/publish.yaml
- pull: ./tasks/pull.yaml
- upgrade: ./tasks/upgrade.yaml
- compliance: ./tasks/compliance.yaml
- badge: ./tasks/badge.yaml
- actions: ./tasks/actions.yaml
tasks:
- name: default
description: Create and deploy the nginx package on a fresh cluster
actions:
- task: create-dev-package
- task: setup:k3d-test-cluster
- task: create-deploy-test-bundle
- name: default-full
description: Create and deploy the nginx package on a fresh cluster with full uds-core
actions:
- task: create-dev-package
- task: setup:k3d-full-cluster
- task: create-deploy-test-bundle
- name: create-dev-package
description: Create UDS nginx Package
actions:
- task: create:package
with:
options: --skip-sbom
- name: dev
description: Create and deploy the bundle against an existing cluster
actions:
- task: create-dev-package
- task: create:test-bundle
- task: deploy:test-bundle
- name: test
description: Test and validate cluster is deployed with nginx
actions:
- wait:
network:
protocol: https
address: nginx.uds.dev
code: 200
- name: create-deploy-test-bundle
description: Test and validate cluster is deployed with nginx
actions:
- description: Create the test bundle
task: create:test-bundle
- description: Deploy the test bundle
task: deploy:test-bundle
- description: Test the bundle
task: test
# CI will execute the following for uds-common specific checks so they need to be here with these names
- name: check-tasks-README
description: Test that `uds run --list=md` output is present in tasks/README.md
actions:
- description: Checking that all tasks are properly listed in tasks/README.md
shell:
linux: bash
darwin: bash
cmd: |
# Assume success unless a task is missing lines
full_success=true
# Loop through each YAML file in the tasks directory
for task_file in tasks/*.yaml; do
echo -e "\033[0;36mProcessing: $task_file\033[0m"
# Capture the output of `uds run --list=md -f <task-file>` line by line
task_output=$(uds run --list=md -f "$task_file")
# Assume success unless a line is missing
success=true
# Check each line of the output against the README
while IFS= read -r line; do
if ! grep -Fq "$line" tasks/README.md; then
echo -e "\033[1;31mMISSING:\033[0m '$line' from $task_file"
success=false
full_success=false
fi
done <<< "$task_output"
# If all lines matched, print success
if [ "$success" = true ]; then
echo -e "\033[1;32mSUCCESS:\033[0m All tasks from $task_file are documented in tasks/README.md"
else
echo -e "Run 'uds run --list=md -f $task_file' to fix"
fi
done
if [ "$full_success" = false ]; then
exit 1
fi
# CI will execute the following (via .github/workflows/callable-test.yaml and .github/workflows/callable-publish.yaml) so they need to be here with these names
- name: test-install
description: Test an install of the nginx package from the current branch
actions:
- description: Create a dev version of the package
task: create-dev-package
- description: Setup the cluster
task: setup:k3d-test-cluster
- description: Create deploy and test the bundle
task: create-deploy-test-bundle
- description: Validate OSCAL compliance
task: compliance:validate
- name: test-upgrade
description: Test an upgrade from the latest released package to the current branch
actions:
- task: upgrade:create-latest-tag-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: compliance:validate
- task: create-dev-package
- task: create-deploy-test-bundle
- task: compliance:validate
- task: compliance:evaluate
- name: publish-release
description: Build and publish the packages
actions:
- description: Create the package
task: create:package
- description: Setup the cluster
task: setup:k3d-test-cluster
- description: Create deploy and test the bundle
task: create-deploy-test-bundle
- description: Publish the packages
task: publish:package