From 8c4ae3536d6cd615724a66b1c65cba2a2bcc3823 Mon Sep 17 00:00:00 2001 From: ritika-du Date: Mon, 28 Oct 2024 14:03:20 -0400 Subject: [PATCH] chore: release unicorn flavor --- .github/workflows/ci-docs-shim.yaml | 19 ++--- .github/workflows/commitlint.yaml | 6 +- .github/workflows/lint.yaml | 33 ++------ .github/workflows/release.yaml | 15 ++-- .github/workflows/test.yaml | 3 + .pre-commit-config.yaml | 3 + bundle/uds-bundle.yaml | 3 + bundle/uds-config.yaml | 2 + chart/templates/uds-package.yaml | 3 + src/namespace/jenkins-ns.yaml | 3 + src/namespace/zarf.yaml | 3 + tasks.yaml | 115 +++++++++++++--------------- tasks/cleanup.yaml | 10 --- tasks/dependencies.yaml | 15 ++++ tasks/publish.yaml | 40 ---------- tasks/test.yaml | 9 +++ values/common.yaml | 3 + values/registry1.yaml | 3 + values/unicorn.yaml | 3 + values/upstream.yaml | 3 + zarf.yaml | 6 +- 21 files changed, 141 insertions(+), 159 deletions(-) delete mode 100644 tasks/cleanup.yaml create mode 100644 tasks/dependencies.yaml delete mode 100644 tasks/publish.yaml diff --git a/.github/workflows/ci-docs-shim.yaml b/.github/workflows/ci-docs-shim.yaml index be02cfa..e83d96a 100644 --- a/.github/workflows/ci-docs-shim.yaml +++ b/.github/workflows/ci-docs-shim.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: CI Docs Shim on: @@ -6,15 +9,13 @@ on: types: [milestoned, opened, synchronize] jobs: - run-test: - name: ${{ matrix.type }} ${{ matrix.flavor }} - runs-on: "ubuntu-latest" - timeout-minutes: 20 + validate: strategy: matrix: - flavor: [upstream, registry1, unicorn] type: [install, upgrade] - steps: - - name: Shim for ${{ matrix.type }} ${{ matrix.flavor }} - run: | - echo "Documentation-only change detected; marking ${{ matrix.type }} ${{ matrix.flavor }} as successful." + flavor: [upstream, unicorn] + uses: defenseunicorns/uds-common/.github/workflows/callable-ci-docs-shim.yaml@f0164622ffc2007e96a0e1deaa3f5064db04b148 # v1.1.0 + with: + flavor: ${{ matrix.flavor }} + type: ${{ matrix.type }} + secrets: inherit # Inherits all secrets from the parent workflow. diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml index 41a2ef7..462063d 100644 --- a/.github/workflows/commitlint.yaml +++ b/.github/workflows/commitlint.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Metadata on: @@ -11,5 +14,4 @@ on: jobs: validate: - name: Validate - uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@24c8a2a48eeb33773b76b3587c489cb17496c9e0 # v0.12.0 + uses: uses: defenseunicorns/uds-common/.github/workflows/callable-commitlint.yaml@f0164622ffc2007e96a0e1deaa3f5064db04b148 # v1.1.0 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a215477..d82018e 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,35 +1,14 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Scan on: # This workflow is triggered on pull requests to the main branch. pull_request: - branches: [main] - types: [milestoned, opened, synchronize] + types: [milestoned, opened, reopened, synchronize] jobs: validate: - runs-on: ubuntu-latest - name: Lint - permissions: - contents: read # Allows reading the repo contents - - steps: - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - - - name: Environment setup - uses: defenseunicorns/uds-common/.github/actions/setup@24c8a2a48eeb33773b76b3587c489cb17496c9e0 # v0.12.0 - with: - registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} - registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} - ghToken: ${{ secrets.GITHUB_TOKEN }} - - - name: Install lint deps - run: | - uds run lint:deps - - - name: Lint the repository - run: | - uds run lint:yaml + uses: defenseunicorns/uds-common/.github/workflows/callable-lint.yaml@f0164622ffc2007e96a0e1deaa3f5064db04b148 # v1.1.0 + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aab6d48..fe06f77 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Release on: @@ -14,7 +17,7 @@ permissions: jobs: tag-new-version: permissions: write-all - runs-on: uds-marketplace-ubuntu-big-boy-4-core + runs-on: ubuntu-latest outputs: release_created: ${{ steps.release-flag.outputs.release_created }} steps: @@ -34,13 +37,9 @@ jobs: strategy: matrix: flavor: [upstream, unicorn] - architecture: [amd64, arm64] - exclude: - - flavor: registry1 - architecture: arm64 + architecture: [amd64] uses: defenseunicorns/uds-common/.github/workflows/callable-publish.yaml@f0164622ffc2007e96a0e1deaa3f5064db04b148 # v1.1.0 with: flavor: ${{ matrix.flavor }} - runsOn: ${{ matrix.architecture == 'arm64' && 'uds-marketplace-ubuntu-arm64-4-core' || 'uds-marketplace-ubuntu-big-boy-4-core' }} - reports-path: "tests/.playwright/reports/" - secrets: inherit # Inherits all secrets from the parent workflow. + runsOn: uds-marketplace-ubuntu-big-boy-4-core + secrets: inherit # Inherits all secrets from the parent workflow. \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ef08715..d2b9bd4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Test # This workflow is triggered on pull requests to the main branch. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc9c66f..5e6510d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 diff --git a/bundle/uds-bundle.yaml b/bundle/uds-bundle.yaml index 8c2d2cb..3e3cdbe 100644 --- a/bundle/uds-bundle.yaml +++ b/bundle/uds-bundle.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + kind: UDSBundle metadata: name: jenkins-test diff --git a/bundle/uds-config.yaml b/bundle/uds-config.yaml index e69de29..e8e24de 100644 --- a/bundle/uds-config.yaml +++ b/bundle/uds-config.yaml @@ -0,0 +1,2 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial \ No newline at end of file diff --git a/chart/templates/uds-package.yaml b/chart/templates/uds-package.yaml index e8d3d0c..cbcbb58 100644 --- a/chart/templates/uds-package.yaml +++ b/chart/templates/uds-package.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + apiVersion: uds.dev/v1alpha1 kind: Package metadata: diff --git a/src/namespace/jenkins-ns.yaml b/src/namespace/jenkins-ns.yaml index 4c7c728..a9659fc 100644 --- a/src/namespace/jenkins-ns.yaml +++ b/src/namespace/jenkins-ns.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + kind: Namespace apiVersion: v1 metadata: diff --git a/src/namespace/zarf.yaml b/src/namespace/zarf.yaml index 140454b..6c6968b 100644 --- a/src/namespace/zarf.yaml +++ b/src/namespace/zarf.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + kind: ZarfPackageConfig metadata: name: dev-namespace diff --git a/tasks.yaml b/tasks.yaml index 1f29a1b..c387e04 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -1,67 +1,53 @@ includes: - - cleanup: ./tasks/cleanup.yaml - test: ./tasks/test.yaml - - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/create.yaml - - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/lint.yaml - - pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/pull.yaml - - deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/deploy.yaml - - upgrade: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/upgrade.yaml - - setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/setup.yaml + - dependencies: ./tasks/dependencies.yaml + - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/create.yaml + - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/lint.yaml + - pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/pull.yaml + - deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/deploy.yaml + - setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/setup.yaml + - actions: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/actions.yaml + - badge: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/badge.yaml + - upgrade: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/upgrade.yaml + - compliance: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/compliance.yaml + - publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.1.0/tasks/publish.yaml tasks: - name: default - description: Create K3D Cluster with UDS-Core + Jenkins + description: Create K3D Cluster with lite UDS-Core + Jenkins actions: - - task: create-jenkins-test-bundle - - task: setup:k3d-test-cluster - # TODO: Remove pinned version after uds-common releases 0.12.1 or later - with: - version: 0.26.1 - - task: deploy:test-bundle - + - task: create-dev-package + - task: setup:k3d-full-cluster + - task: create-deploy-test-bundle + - name: default-full - description: Create K3D Cluster with UDS-Core + Jenkins + description: Create K3D Cluster with full UDS-Core + Jenkins actions: - - task: create-jenkins-test-bundle + - task: create-dev-package - task: setup:k3d-full-cluster - # TODO: Remove pinned version after uds-common releases 0.12.1 or later - with: - version: 0.26.1 - - task: deploy:test-bundle + - task: create-deploy-test-bundle - - name: create-jenkins-package + - name: create-dev-package description: Create UDS Jenkins Package actions: - task: create:package with: options: "--skip-sbom" - - name: create-jenkins-test-bundle - description: Create a local UDS Jenkins bundle - actions: - - task: create-jenkins-package - - task: create:test-bundle - - - name: create-jenkins-latest-release-bundle - description: Create UDS Jenkins bundle based on the latest release + - name: create-deploy-test-bundle + description: Test and validate cluster is deployed with Jenkins actions: - - task: pull:latest-package-release - with: - spoof_release: "true" + - task: dependencies:create - task: create:test-bundle - - - name: setup-cluster - description: Setup a K3D cluster with UDS-Core-Slim - actions: - - task: setup:k3d-test-cluster - # TODO: Remove pinned version after uds-common releases 0.12.1 or later - with: - version: 0.26.1 + - task: deploy:test-bundle + - task: setup:create-doug-user + - task: test:all - name: dev - description: Create then deploy local jenkins bundle + description: Create and deploy the bundle on an existing cluster (for iteration/dev speed) actions: - - task: create-jenkins-test-bundle + - task: create-dev-package + - task: create:test-bundle - task: deploy:test-bundle # CI will execute the following (via uds-common/.github/actions/test) so they need to be here with these names @@ -69,29 +55,38 @@ tasks: - name: test-package description: Test the Jenkins package from the current branch actions: - - task: create-jenkins-test-bundle + - task: dependencies:create + - task: create-dev-package - task: setup:k3d-test-cluster - # TODO: Remove pinned version after uds-common releases 0.12.1 or later - with: - version: 0.26.1 - - task: deploy:test-bundle - - task: setup:create-doug-user - - task: test:health-check - - task: test:ingress + - task: create-deploy-test-bundle - task: test:ui - name: test-upgrade description: Test an upgrade from the latest released package to the current branch actions: + - task: dependencies:create - task: upgrade:create-latest-tag-bundle - task: setup:k3d-test-cluster - # TODO: Remove pinned version after uds-common releases 0.12.1 or later - with: - version: 0.26.1 - task: deploy:test-bundle - - task: create-jenkins-test-bundle - - task: deploy:test-bundle - - task: setup:create-doug-user - - task: test:health-check - - task: test:ingress - - task: test:ui + - task: create-dev-package + - task: create-deploy-test-bundle + + + - name: publish-package + 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 + with: + # x-release-please-start-version + version: 3.72.0-uds.0 + # x-release-please-end diff --git a/tasks/cleanup.yaml b/tasks/cleanup.yaml deleted file mode 100644 index d28da9c..0000000 --- a/tasks/cleanup.yaml +++ /dev/null @@ -1,10 +0,0 @@ -tasks: - - name: cluster - actions: - - description: Destroy k3d cluster - cmd: k3d cluster delete uds - - - name: bundle - actions: - - description: Remove the Deployed UDS Jenkins Bundle - cmd: ./uds remove ./bundle/uds-bundle-jenkins-test*.tar.zst --confirm --no-progress diff --git a/tasks/dependencies.yaml b/tasks/dependencies.yaml new file mode 100644 index 0000000..48a5492 --- /dev/null +++ b/tasks/dependencies.yaml @@ -0,0 +1,15 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + +tasks: + - name: create + description: Create the Dev-Secrets Dependency Zarf Package + inputs: + options: + description: For setting create time variables and flags + architecture: + description: The architecture of the package to create + default: ${UDS_ARCH} + actions: + - cmd: ./uds zarf package create src/dev-secrets/ --confirm --no-progress --architecture=${{ .inputs.architecture }} --skip-sbom ${{ .inputs.options }} + - cmd: ./uds zarf package create src/namespace/ --confirm --no-progress --architecture=${{ .inputs.architecture }} --skip-sbom ${{ .inputs.options }} \ No newline at end of file diff --git a/tasks/publish.yaml b/tasks/publish.yaml deleted file mode 100644 index 4e858a8..0000000 --- a/tasks/publish.yaml +++ /dev/null @@ -1,40 +0,0 @@ -includes: - - dependencies: ./dependencies.yaml - - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/create.yaml - - publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.12.0/tasks/publish.yaml - -tasks: - - name: package - description: Build and publish the packages - actions: - - description: Create the AMD64 package - task: create:package - with: - architecture: amd64 - - - description: Publish the packages - task: publish:package - with: - # x-release-please-start-version - version: "5.6.1-uds.0" - # x-release-please-end - - - name: test-bundle - description: Build and publish the test bundles - actions: - - description: Create the AMD64 deps package - task: dependencies:create - with: - architecture: amd64 - - - description: Create the AMD64 bundle - task: create:test-bundle - with: - architecture: amd64 - - - description: Publish the bundles - task: publish:test-bundle - with: - # x-release-please-start-version - version: "5.6.1-uds.0" - # x-release-please-end diff --git a/tasks/test.yaml b/tasks/test.yaml index dfe00c3..752e193 100644 --- a/tasks/test.yaml +++ b/tasks/test.yaml @@ -1,4 +1,13 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + tasks: + - name: all + description: Create K3D Cluster with UDS-Core + Securecodebox + actions: + - task: health-check + - task: ingress + - name: health-check actions: - description: Jenkins StatefulSet Health Check diff --git a/values/common.yaml b/values/common.yaml index 254b186..035af56 100644 --- a/values/common.yaml +++ b/values/common.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + controller: jenkinsUrl: https://jenkins.###ZARF_VAR_DOMAIN### disableRememberMe: true diff --git a/values/registry1.yaml b/values/registry1.yaml index 8d09e87..162e6ba 100644 --- a/values/registry1.yaml +++ b/values/registry1.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + controller: image: registry: "registry1.dso.mil" diff --git a/values/unicorn.yaml b/values/unicorn.yaml index 3e01488..c872f9e 100644 --- a/values/unicorn.yaml +++ b/values/unicorn.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + controller: image: registry: "cgr.dev" diff --git a/values/upstream.yaml b/values/upstream.yaml index f5ba17a..507eaa0 100644 --- a/values/upstream.yaml +++ b/values/upstream.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + controller: image: registry: "docker.io" diff --git a/zarf.yaml b/zarf.yaml index 2023c78..c61af8d 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -1,11 +1,12 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + # yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json kind: ZarfPackageConfig metadata: name: jenkins description: "UDS Jenkins package" - # x-release-please-start-version version: "5.6.1-uds.0" - # x-release-please-end architecture: amd64 variables: @@ -56,7 +57,6 @@ components: - registry1.dso.mil/ironbank/opensource/jenkins/inbound-agent:3186.vc3b_7249b_87eb_-1 - registry1.dso.mil/ironbank/kiwigrid/k8s-sidecar:1.27.6 - # Note: unicorn flavor is experimental - name: jenkins required: true description: "Deploy jenkins with unicorn images"