Skip to content

Commit

Permalink
Add UDS Tasks (#47)
Browse files Browse the repository at this point in the history
* feat: internal uds.dev resolution

* remove duplicate line

Co-authored-by: Micah Nagel <[email protected]>

* move coredns patch to uds-dev-stack

* ci: use uds tasks in ci
  • Loading branch information
rjferguson21 authored Mar 1, 2024
1 parent 0dd4735 commit a399841
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Zarf
uses: defenseunicorns/setup-zarf@main
with:
# renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver
version: v0.32.4
- name: Setup UDS
if: always()
uses: defenseunicorns/uds-common/.github/actions/[email protected]

- run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash"
shell: bash
- name: Create and deploy the uds-k3d package
run: uds run

- name: Create Zarf Package
run: zarf package create --confirm
- name: Validate uds-k3d package
run: uds run validate

- name: Deploy the capability
run: zarf package deploy zarf-package-uds-k3d-*.tar.zst --confirm
12 changes: 5 additions & 7 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Zarf
uses: defenseunicorns/setup-zarf@main
with:
# renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver
version: v0.32.4
- name: Setup UDS
if: always()
uses: defenseunicorns/uds-common/.github/actions/[email protected]

- name: Login to GHCR
uses: docker/login-action@v3
Expand All @@ -47,5 +45,5 @@ jobs:

- name: Publish the capability
run: |
zarf package create --confirm -a arm64 -o oci://ghcr.io/defenseunicorns/packages
zarf package create --confirm -a amd64 -o oci://ghcr.io/defenseunicorns/packages
uds zarf package create --confirm -a arm64 -o oci://ghcr.io/defenseunicorns/packages
uds zarf package create --confirm -a amd64 -o oci://ghcr.io/defenseunicorns/packages
29 changes: 29 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
tasks:
- name: default
description: "Build and deploy uds-k3d"
actions:
- description: "Build UDS K3d package"
cmd: "uds zarf package create --confirm"

- description: "Deploy UDS K3d package"
cmd: "uds zarf package deploy zarf-package-uds-k3d-*.tar.zst --confirm"

- name: validate
actions:
- description: Validate coredns is up
wait:
cluster:
kind: Pod
name: "k8s-app=kube-dns"
namespace: kube-system
condition: Ready
- description: Validate coredns is resolving *.uds.dev internally
cmd: |
set -e
FOO_IP=$(uds zarf tools kubectl run dig-test --image=arunvelsriram/utils -q --restart=Never --rm -i -- dig +short foo.uds.dev)
if [ "${FOO_IP}" != "127.0.0.1" ]; then
echo "CoreDNS is resolving foo.uds.dev to host.k3d.internal"
else
echo "CoreDNS patch failed, foo.uds.dev is resolving to 127.0.0.1"
exit 1
fi

0 comments on commit a399841

Please sign in to comment.