Skip to content

Commit

Permalink
feat(task)!: add optional config input to create, deploy package and …
Browse files Browse the repository at this point in the history
…bundle tasks (#262)

Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
  • Loading branch information
justinthelaw and Racer159 authored Oct 4, 2024
1 parent a733122 commit 3d3e9cb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
22 changes: 15 additions & 7 deletions tasks/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ tasks:
architecture:
description: The architecture of the package to create
default: ${UDS_ARCH}
config:
description: Optionally provide a path to a Zarf config file
default: ""
required: false
actions:
- cmd: |
if [ "${FLAVOR}" != "registry1" ] || [ ${{ .inputs.architecture }} != "arm64" ]; then
./uds zarf package create ${{ .inputs.path }} --confirm --no-progress --architecture="${{ .inputs.architecture }}" --flavor="${FLAVOR}" ${{ .inputs.options }}
- env:
- ZARF_CONFIG=${{ .inputs.config }}
cmd: |
if [ "${FLAVOR}" != "registry1" ] || [ "${{ .inputs.architecture }}" != "arm64" ]; then
./uds zarf package create ${{ .inputs.path }} --confirm --no-progress --architecture="${{ .inputs.architecture }}" --flavor "${FLAVOR}" ${{ .inputs.options }}
else
echo "Registry1 packages cannot be made for 'arm64'"
fi
Expand All @@ -31,15 +37,17 @@ tasks:
description: Path relative to the repositories root where the uds-bundle.yaml lives
default: bundle
config:
description: File name of the bundle config file. Defaults to uds-config.yaml. Path is relative to the path input.
default: uds-config.yaml
description: Path to the bundle config file. Defaults to bundle/uds-config.yaml.
default: bundle/uds-config.yaml
architecture:
description: The architecture of the bundle to create
default: ${UDS_ARCH}
actions:
- cmd: |
- env:
- UDS_CONFIG=${{ .inputs.config }}
cmd: |
if [ "${FLAVOR}" != "registry1" ] || [ "${{ .inputs.architecture }}" != "arm64" ]; then
UDS_CONFIG=${{ .inputs.path }}/${{ .inputs.config }} ./uds create ${{ .inputs.path }} --confirm --no-progress --architecture="${{ .inputs.architecture }}" ${{ .inputs.options }}
./uds create ${{ .inputs.path }} --confirm --no-progress --architecture="${{ .inputs.architecture }}" ${{ .inputs.options }}
else
echo "Registry1 bundles cannot be made for 'arm64'"
fi
14 changes: 11 additions & 3 deletions tasks/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ tasks:
path:
description: Path relative to the repositories root where the zarf.yaml and .tar.zst lives
default: .
config:
description: Optionally provide a path to a Zarf config file
default: ""
required: false
actions:
- description: Get the current Zarf package name
cmd: cat ${{ .inputs.path }}/zarf.yaml | ./uds zarf tools yq .metadata.name
Expand All @@ -17,6 +21,8 @@ tasks:
setVariables:
- name: PACKAGE_VERSION
- description: Deploy the UDS Zarf Package
env:
- ZARF_CONFIG=${{ .inputs.config }}
cmd: ./uds zarf package deploy "${{ .inputs.path }}/zarf-package-${PACKAGE_NAME}-${UDS_ARCH}-${PACKAGE_VERSION}.tar.zst" --confirm --no-progress ${{ .inputs.options }}

- name: test-bundle
Expand All @@ -26,8 +32,8 @@ tasks:
description: Path relative to the repositories root where the uds-bundle.yaml and .tar.zst lives
default: bundle
config:
description: File name of the bundle config file. Defaults to uds-config.yaml. Path is relative to the path input.
default: uds-config.yaml
description: Path to the bundle config file. Defaults to bundle/uds-config.yaml.
default: bundle/uds-config.yaml
options:
description: For setting deploy time variables and flags
actions:
Expand All @@ -40,4 +46,6 @@ tasks:
setVariables:
- name: BUNDLE_VERSION
- description: Deploy the UDS bundle with the package and its dependencies
cmd: UDS_CONFIG=${{ .inputs.path }}/${{ .inputs.config }} ./uds deploy "${{ .inputs.path }}/uds-bundle-${BUNDLE_NAME}-${UDS_ARCH}-${BUNDLE_VERSION}.tar.zst" --confirm --no-progress ${{ .inputs.options }}
env:
- UDS_CONFIG=${{ .inputs.config }}
cmd: ./uds deploy "${{ .inputs.path }}/uds-bundle-${BUNDLE_NAME}-${UDS_ARCH}-${BUNDLE_VERSION}.tar.zst" --confirm --no-progress ${{ .inputs.options }}

0 comments on commit 3d3e9cb

Please sign in to comment.