/ tasks.yaml
tasks.yaml
1 # Copyright 2024 Defense Unicorns 2 # SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial 3 4 variables: 5 - name: FLAVOR 6 default: upstream 7 8 - name: LAYER 9 10 includes: 11 - create: ./tasks/create.yaml 12 - setup: ./tasks/setup.yaml 13 - deploy: ./tasks/deploy.yaml 14 - test: ./tasks/test.yaml 15 - lint: ./tasks/lint.yaml 16 - diagrams: ./tasks/diagrams.yaml 17 18 tasks: 19 - name: default 20 actions: 21 - description: "Build, deploy and test UDS Core" 22 task: test-uds-core 23 24 - name: dev-setup 25 description: "Create k3d cluster with istio" 26 inputs: 27 istio_components: 28 description: "Comma separated list of istio components to deploy" 29 default: "" 30 actions: 31 - description: "Create the dev cluster" 32 task: setup:create-k3d-cluster 33 34 - description: "Register CRDs in cluster" 35 cmd: npx ts-node -e "import { registerCRDs } from './src/pepr/operator/crd/register'; registerCRDs()" 36 env: 37 - "PEPR_MODE=dev" 38 39 - description: "Create required namespaces" 40 cmd: | 41 uds zarf tools kubectl create ns uds-policy-exemptions 42 uds zarf tools kubectl create ns istio-system 43 uds zarf tools kubectl create ns pepr-system 44 45 - description: "Deploy the UDS Cluster Config CRD and apply all hack dev manifests" 46 cmd: | 47 uds zarf tools kubectl apply -f src/pepr/uds-cluster-crds/templates/clusterconfig.uds.dev.yaml 48 uds zarf tools kubectl apply -f hack/dev-manifests/ 49 50 # Note: the `registry-url` flag used here requires uds 0.19.2+ 51 - description: "Deploy the Istio source package with Zarf Dev" 52 cmd: "uds zarf dev deploy src/istio --flavor upstream --registry-url docker.io --no-progress --components=${{ .inputs.istio_components }}" 53 54 # Note: Since this is a dev deploy without any `--flavor` it only deploys the CRDs (other components are flavored) 55 - description: "Deploy the Prometheus-Stack source package with Zarf Dev to only install the CRDs" 56 cmd: "uds zarf dev deploy src/prometheus-stack --no-progress" 57 58 - description: "Dev instructions" 59 cmd: | 60 echo "Next steps:" 61 echo " - To test & develop the Pepr module, run 'npx pepr dev' from a Javascript debug terminal" 62 echo " - Otherwise run 'npx pepr deploy' to deploy the Pepr module to the cluster" 63 echo " - Additional source packages can be deployed with 'zarf dev deploy src/<package> --flavor upstream'" 64 65 - name: slim-dev 66 actions: 67 - description: "Build slim dev bundle" 68 task: create:k3d-slim-dev-bundle 69 70 - description: "Deploy slim dev bundle" 71 task: deploy:k3d-slim-dev-bundle 72 73 - name: slim-dev-ha 74 description: "Build and deploy slim dev bundle with HA configuration" 75 actions: 76 - description: "Setup HA PostgreSQL" 77 task: setup:ha-postgres 78 - description: "Setup HA Redis" 79 task: setup:ha-redis 80 - description: "Build slim dev bundle" 81 task: create:k3d-slim-dev-bundle 82 - description: "Deploy slim dev bundle with HA configuration" 83 task: deploy:k3d-slim-dev-bundle-ha 84 85 - name: dev-identity 86 description: "Create k3d cluster with istio, Pepr, Keycloak, and Authservice for development" 87 actions: 88 - task: dev-setup 89 90 - description: "Deploy Pepr" 91 cmd: "npx pepr deploy --yes" 92 93 - description: "Deploy Keycloak + Authservice" 94 cmd: "uds run dev-deploy --set LAYER=identity-authorization --no-progress" 95 96 - name: dev-deploy 97 description: "Deploy the given core layer with Zarf Dev" 98 actions: 99 - cmd: "uds zarf dev deploy packages/${LAYER} --flavor ${FLAVOR} --components '*' --no-progress" 100 101 - name: setup-cluster 102 description: "Create a k3d Cluster and Initialize with Zarf" 103 actions: 104 - task: setup:k3d-test-cluster 105 106 - name: create-standard-package 107 description: "Create UDS Core Zarf Package, `upstream` flavor default, use --set FLAVOR={flavor} to change" 108 actions: 109 - task: create:standard-package 110 111 - name: test-single-layer 112 description: "Deploys k3d cluster, layer dependencies and the provided layer (based on LAYER variable)" 113 actions: 114 - task: test:layer-dependencies 115 - task: test:single-layer 116 117 - name: deploy-standard-bundle 118 actions: 119 - task: deploy:k3d-standard-bundle 120 121 - name: test-uds-core 122 description: "Build and test UDS Core" 123 actions: 124 - task: test:uds-core 125 126 - name: test-uds-core-multi-node 127 description: "Deploys UDS Core on a multi-node cluster (based on K3D_EXTRA_ARGS variable)" 128 actions: 129 - task: test:uds-core 130 with: 131 K3D_EXTRA_ARGS: "--servers 3 --agents 2" 132 133 - name: test-uds-core-ha 134 description: "Build and test UDS Core" 135 actions: 136 - task: setup:ha-postgres 137 - task: setup:ha-redis 138 - task: test:uds-core-ha 139 140 - name: test-uds-core-ha-upgrade 141 description: "Test an upgrade from the latest released UDS Core package with HA to current branch with HA" 142 actions: 143 - task: setup:ha-postgres 144 - task: setup:ha-redis 145 - task: test:uds-core-ha-upgrade 146 147 - name: test-uds-core-upgrade 148 description: "Test an upgrade from the latest released UDS Core package to current branch" 149 actions: 150 - task: test:uds-core-upgrade 151 152 - name: lint-check 153 description: "Run linting checks" 154 actions: 155 - task: lint:check 156 157 - name: lint-fix 158 description: "Fix linting issues" 159 actions: 160 - task: lint:fix 161 162 # Note that due to cloning the docs repo (which is private) this task will require organization access to the repo 163 # This task does not clone in/manage docs outside of the core repo so you may hit some 404s during development 164 # This task does not run the integration-script in the uds-docs repo, the sidebar will not be the same as the live docs 165 - name: dev-docs 166 description: "Start the dev docs server" 167 actions: 168 - description: "Cleanup previous runs" 169 cmd: | 170 rm -rf uds-docs 171 - description: "Clone the docs repo and symlink the reference docs" 172 cmd: | 173 git clone https://github.com/defenseunicorns/uds-docs.git uds-docs 174 rm -rf uds-docs/src/content/docs/reference uds-docs/src/content/docs/.images uds-docs/src/content/docs/.c4 175 # This only symlinks the reference, images, and c4 folders since these are the only docs we use in the docs site 176 ln -s $(pwd)/docs/reference uds-docs/src/content/docs/reference 177 ln -s $(pwd)/docs/.images uds-docs/src/content/docs/.images 178 ln -s $(pwd)/docs/.c4 uds-docs/src/content/docs/.c4 179 - description: "Start the docs server with npm (this will run until you stop it)" 180 cmd: | 181 # Actual startup takes up to a minute because of the npm install 182 cd uds-docs && npm i && echo "Sidebar will be different from the live docs, this is expected" && npm run dev && echo "" 183 184 - name: uds-docs-validate 185 description: "Validate and build uds-docs with latest uds-core docs" 186 actions: 187 - description: "Cleanup previous runs" 188 cmd: | 189 rm -rf uds-docs 190 - description: "Clone the docs repo" 191 cmd: git clone https://github.com/defenseunicorns/uds-docs.git uds-docs 192 - description: "UDS Docs Integration Script" 193 cmd: cd uds-docs && npm i && DOCS_OVERRIDES="uds-core=$(pwd)/.." npm run build 194 195 - name: update-diagrams 196 description: "Regenerate C4 and D2 Diagrams" 197 actions: 198 - description: "Regenerate operator resource tree" 199 task: diagrams:d2-update 200 - description: "Regenerate C4 Diagrams" 201 task: diagrams:c4-update 202 203 - name: check-ca-certs 204 description: "Checks CA certificates for updates" 205 actions: 206 - cmd: npx ts-node --project scripts/root-ca-retriever/tsconfig.json scripts/root-ca-retriever/index.ts --check 207 208 - name: update-ca-certs 209 description: "Updates CA certificates" 210 actions: 211 - cmd: npx ts-node --project scripts/root-ca-retriever/tsconfig.json scripts/root-ca-retriever/index.ts