|
| 1 | +# Copyright AGNTCY Contributors (https://github.com/agntcy) |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +--- |
| 5 | +name: Deploy agntcy components |
| 6 | +description: Deploy agntcy components for integration testing |
| 7 | +inputs: |
| 8 | + checkout-repository: |
| 9 | + description: 'Checkout AGNTCY repository' |
| 10 | + required: false |
| 11 | + default: 'false' |
| 12 | + checkout-path: |
| 13 | + description: 'Path to checkout AGNTCY repository' |
| 14 | + required: false |
| 15 | + default: '' |
| 16 | + deploy-gateway: |
| 17 | + description: 'Deploy gateway to a kind cluster' |
| 18 | + required: false |
| 19 | + default: 'false' |
| 20 | + gateway-image-tag: |
| 21 | + description: 'Set gateway container image version' |
| 22 | + required: false |
| 23 | + default: '' |
| 24 | + deploy-directory: |
| 25 | + description: 'Deploy directory to a kind cluster' |
| 26 | + required: false |
| 27 | + default: 'false' |
| 28 | + directory-image-tag: |
| 29 | + description: 'Set directory container image version' |
| 30 | + required: false |
| 31 | + default: '' |
| 32 | + kind-cluster-name: |
| 33 | + description: 'Set kind cluster name where components are deployed' |
| 34 | + required: false |
| 35 | + default: 'agntcy-test' |
| 36 | + kind-cluster-namespace: |
| 37 | + description: 'Set cluster namespace where components are deployed' |
| 38 | + required: false |
| 39 | + default: 'default' |
| 40 | + github-repository-ref: |
| 41 | + description: 'Set a ref for git checkout' |
| 42 | + required: false |
| 43 | + default: 'main' |
| 44 | + install-kind-dependency: |
| 45 | + description: 'KinD installer' |
| 46 | + required: false |
| 47 | + default: 'false' |
| 48 | + kind-binary-version: |
| 49 | + description: 'Installed KinD version' |
| 50 | + required: false |
| 51 | + default: 'v0.27.0' |
| 52 | + install-taskfile-dependency: |
| 53 | + description: 'Taskfile installer' |
| 54 | + required: false |
| 55 | + default: 'false' |
| 56 | + |
| 57 | +runs: |
| 58 | + using: composite |
| 59 | + steps: |
| 60 | + - name: Checkout agntcy repository |
| 61 | + if: ${{ inputs.checkout-repository != 'false' }} |
| 62 | + uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + repository: 'agntcy/csit' |
| 65 | + ref: ${{ inputs.github-repository-ref }} |
| 66 | + path: ${{ inputs.checkout-path }} |
| 67 | + |
| 68 | + - name: Install KinD |
| 69 | + if: ${{ inputs.install-kind-depedency != 'false' }} |
| 70 | + shell: bash |
| 71 | + run: | |
| 72 | + ARCH="" |
| 73 | + if [ $(uname -m) = x86_64 ]; then |
| 74 | + ARCH="amd64" |
| 75 | + elif [ $(uname -m) = aarch64 ]; then |
| 76 | + ARCH="arm64" |
| 77 | + else |
| 78 | + echo "Unkown architecture, abort!" |
| 79 | + exit 1 |
| 80 | + fi |
| 81 | +
|
| 82 | + curl -Lo ./kind https://kind.sigs.k8s.io/dl/${{ inputs.kind-binary-version }}/kind-linux-$ARCH |
| 83 | +
|
| 84 | + chmod +x ./kind |
| 85 | + sudo mv ./kind /usr/local/bin/kind |
| 86 | +
|
| 87 | + - name: Install Taskfile |
| 88 | + if: ${{ inputs.install-taskfile-depedency != 'false' }} |
| 89 | + uses: arduino/setup-task@v2 |
| 90 | + with: |
| 91 | + version: 3.x |
| 92 | + |
| 93 | + - name: Create kind cluster |
| 94 | + shell: bash |
| 95 | + run: | |
| 96 | + task -d ./${{ inputs.checkout-path }} integrations:kind:create \ |
| 97 | + KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} |
| 98 | +
|
| 99 | + - name: Deploy Gateway |
| 100 | + if: ${{ inputs.deploy-gateway != 'false' }} |
| 101 | + shell: bash |
| 102 | + run: | |
| 103 | + task -d ./${{ inputs.checkout-path }} integrations:gateway:test-env:deploy \ |
| 104 | + GATEWAY_IMAGE_TAG=${{ inputs.gateway-image-tag }} \ |
| 105 | + KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \ |
| 106 | + HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }} |
| 107 | +
|
| 108 | + - name: Deploy Directory |
| 109 | + if: ${{ inputs.deploy-directory != 'false' }} |
| 110 | + shell: bash |
| 111 | + run: | |
| 112 | + task -d ./${{ inputs.checkout-path }} integrations:directory:test-env:deploy \ |
| 113 | + DIRECTORY_IMAGE_TAG=${{ inputs.directory-image-tag }} \ |
| 114 | + KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \ |
| 115 | + HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }} |
0 commit comments