From 5fd179eeedd0ac1dbfb9413c8bcd3fe59a1ec4a4 Mon Sep 17 00:00:00 2001 From: audrastump Date: Thu, 14 Nov 2024 11:14:13 -0800 Subject: [PATCH 1/7] test workflow Revert file to master cleaned up more cleaning Update generate-workflow.go revert changes removed unnecessary changes removed kubeconfig env updated tidied yaml file Update setup-gh.go made changes in wf helpers test devhub integration removed fleet input added resource type changes, deployment changes based on devhub draft manifest template for fleet version bump removed changes besides template draft changes for helm and kustomize changed resource type to cluster resource type changed resource type name nit changes nits Fleet changes for draft fixed unit tests added fixture changes Update azure-kubernetes-service-helm.yml Fix typo in CLUSTER_RESOURCE_TYPE value testing changes changes to helm template --- .../azure-kubernetes-service-helm.yml | 18 +++++++++++++----- .../azure-kubernetes-service-kustomize.yml | 14 +++++++++----- .../workflows/azure-kubernetes-service.yml | 14 +++++++++----- .../workflows_github_helm_test.go | 1 + .../workflows_github_kustomize_test.go | 1 + .../azure-kubernetes-service-helm.yml | 17 +++++++++++++---- .../azure-kubernetes-service-kustomize.yml | 14 +++++++++----- .../workflows/azure-kubernetes-service.yml | 14 +++++++++----- 8 files changed, 64 insertions(+), 29 deletions(-) diff --git a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml index c11b857b..2e668ac0 100644 --- a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -20,8 +20,9 @@ # - ACR_RESOURCE_GROUP (resource group of your ACR) # - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR) # - CONTAINER_NAME (name of the container image you would like to push up to your ACR) +# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name) # - CLUSTER_RESOURCE_GROUP (where your cluster is deployed) -# - CLUSTER_NAME (name of your AKS cluster) +# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters') # - DOCKER_FILE (path to your Dockerfile) # - BUILD_CONTEXT_PATH (path to the context of your Dockerfile) # - CHART_PATH (path to your helm chart) @@ -44,8 +45,9 @@ env: ACR_RESOURCE_GROUP: testAcrRG AZURE_CONTAINER_REGISTRY: testAcr CONTAINER_NAME: testContainer - CLUSTER_RESOURCE_GROUP: testClusterRG CLUSTER_NAME: testCluster + CLUSTER_RESOURCE_GROUP: testClusterRG + CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/managedClusters DOCKER_FILE: ./Dockerfile BUILD_CONTEXT_PATH: test CHART_PATH: testPath @@ -102,16 +104,18 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v3 + uses: azure/aks-set-context@v4.0.2 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} admin: "false" use-kubelogin: "true" # Checks if the AKS cluster is private - name: Is private cluster id: isPrivate + if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} run: | result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster") echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT" @@ -124,11 +128,15 @@ jobs: result=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id) echo "Helm upgrade result: $result" exitCode=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id --query exitCode -o tsv) - if [ $exitCode -ne 0 ]; then exit $exitCode fi - name: Deploy application on public cluster if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' - run: helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace + run: | + if [ "${{ env.CLUSTER_RESOURCE_TYPE }}" == "Microsoft.ContainerService/fleets" ]; then + helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + else + helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace + fi diff --git a/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml b/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml index ee198518..93a35702 100644 --- a/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml +++ b/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml @@ -20,8 +20,9 @@ # - ACR_RESOURCE_GROUP (resource group of your ACR) # - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR) # - CONTAINER_NAME (name of the container image you would like to push up to your ACR) +# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name) # - CLUSTER_RESOURCE_GROUP (where your cluster is deployed) -# - CLUSTER_NAME (name of your AKS cluster) +# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedCluster') # - DOCKER_FILE (path to your Dockerfile) # - BUILD_CONTEXT_PATH (path to the context of your Dockerfile) # - NAMESPACE (namespace to deploy your application) @@ -45,8 +46,9 @@ env: ACR_RESOURCE_GROUP: testAcrRG AZURE_CONTAINER_REGISTRY: testAcr CONTAINER_NAME: testContainer - CLUSTER_RESOURCE_GROUP: testClusterRG CLUSTER_NAME: testCluster + CLUSTER_RESOURCE_GROUP: testClusterRG + CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/managedClusters KUSTOMIZE_PATH: ./overlays/production DOCKER_FILE: ./Dockerfile BUILD_CONTEXT_PATH: test @@ -101,12 +103,13 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v3 + uses: azure/aks-set-context@v4.0.2 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} admin: 'false' use-kubelogin: 'true' + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} # Runs Kustomize to create manifest files - name: Bake deployment @@ -116,9 +119,9 @@ jobs: kustomizationPath: ${{ env.KUSTOMIZE_PATH }} kubectl-version: latest id: bake - # Checks if the AKS cluster is private - name: Is private cluster + if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} id: isPrivate run: | result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster") @@ -126,7 +129,7 @@ jobs: # Deploys application based on manifest files from previous step - name: Deploy application - uses: Azure/k8s-deploy@v4 + uses: Azure/k8s-deploy@v5.0.1 with: action: deploy manifests: ${{ steps.bake.outputs.manifestsBundle }} @@ -136,4 +139,5 @@ jobs: name: ${{ env.CLUSTER_NAME }} private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }} namespace: ${{ env.NAMESPACE }} + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} diff --git a/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml b/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml index 92c2dbff..2dc6443c 100644 --- a/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml +++ b/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml @@ -18,14 +18,14 @@ # 2. Set the following environment variables (or replace the values below): # - ACR_RESOURCE_GROUP (resource group of your ACR) # - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR) +# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name) # - CLUSTER_RESOURCE_GROUP (where your cluster is deployed) -# - CLUSTER_NAME (name of your AKS cluster) +# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters') # - CONTAINER_NAME (name of the container image you would like to push up to your ACR) # - DEPLOYMENT_MANIFEST_PATH (path to the manifest yaml for your deployment) # - DOCKER_FILE (path to your Dockerfile) # - BUILD_CONTEXT_PATH (path to the context of your Dockerfile) # - NAMESPACE (namespace to deploy your application) -# # For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions # For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples # For more options with the actions used below please refer to https://github.com/Azure/login @@ -41,8 +41,9 @@ env: ACR_RESOURCE_GROUP: testAcrRG AZURE_CONTAINER_REGISTRY: testAcr CONTAINER_NAME: testContainer - CLUSTER_RESOURCE_GROUP: testClusterRG CLUSTER_NAME: testCluster + CLUSTER_RESOURCE_GROUP: testClusterRG + CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/managedClusters DEPLOYMENT_MANIFEST_PATH: ./manifests DOCKER_FILE: ./Dockerfile BUILD_CONTEXT_PATH: test @@ -97,15 +98,17 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v3 + uses: azure/aks-set-context@v4.0.2 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} admin: 'false' use-kubelogin: 'true' + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} # Checks if the AKS cluster is private - name: Is private cluster + if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} id: isPrivate run: | result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster") @@ -113,7 +116,7 @@ jobs: # Deploys application based on given manifest file - name: Deploys application - uses: Azure/k8s-deploy@v4 + uses: Azure/k8s-deploy@v5.0.1 with: action: deploy manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }} @@ -123,3 +126,4 @@ jobs: name: ${{ env.CLUSTER_NAME }} private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }} namespace: ${{ env.NAMESPACE }} + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} diff --git a/pkg/handlers/templatetests/workflows_github_helm_test.go b/pkg/handlers/templatetests/workflows_github_helm_test.go index 179d1f03..36901e54 100644 --- a/pkg/handlers/templatetests/workflows_github_helm_test.go +++ b/pkg/handlers/templatetests/workflows_github_helm_test.go @@ -22,6 +22,7 @@ func TestGitHubWorkflowHelmTemplates(t *testing.T) { "AZURECONTAINERREGISTRY": "testAcr", "CONTAINERNAME": "testContainer", "CLUSTERRESOURCEGROUP": "testClusterRG", + "CLUSTERRESOURCETYPE": "managedClusters", "CLUSTERNAME": "testCluster", "KUSTOMIZEPATH": "./overlays/production", "DEPLOYMENTMANIFESTPATH": "./manifests", diff --git a/pkg/handlers/templatetests/workflows_github_kustomize_test.go b/pkg/handlers/templatetests/workflows_github_kustomize_test.go index 69894be0..35ac3f2e 100644 --- a/pkg/handlers/templatetests/workflows_github_kustomize_test.go +++ b/pkg/handlers/templatetests/workflows_github_kustomize_test.go @@ -22,6 +22,7 @@ func TestGitHubWorkflowKustomizeTemplates(t *testing.T) { "AZURECONTAINERREGISTRY": "testAcr", "CONTAINERNAME": "testContainer", "CLUSTERRESOURCEGROUP": "testClusterRG", + "CLUSTERRESOURCETYPE": "managedClusters", "CLUSTERNAME": "testCluster", "DEPLOYMENTMANIFESTPATH": "./manifests", "DOCKERFILE": "./Dockerfile", diff --git a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml index 0a39ee85..6e2f8129 100644 --- a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -20,8 +20,9 @@ # - ACR_RESOURCE_GROUP (resource group of your ACR) # - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR) # - CONTAINER_NAME (name of the container image you would like to push up to your ACR) +# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name) # - CLUSTER_RESOURCE_GROUP (where your cluster is deployed) -# - CLUSTER_NAME (name of your AKS cluster) +# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters') # - DOCKER_FILE (path to your Dockerfile) # - BUILD_CONTEXT_PATH (path to the context of your Dockerfile) # - CHART_PATH (path to your helm chart) @@ -44,8 +45,9 @@ env: ACR_RESOURCE_GROUP: {{ .Config.GetVariableValue "ACRRESOURCEGROUP" }} AZURE_CONTAINER_REGISTRY: {{ .Config.GetVariableValue "AZURECONTAINERREGISTRY" }} CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }} - CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }} + CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} + CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }} BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }} CHART_PATH: {{ .Config.GetVariableValue "CHARTPATH" }} @@ -102,16 +104,18 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v3 + uses: azure/aks-set-context@v4.0.2 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} admin: "false" use-kubelogin: "true" # Checks if the AKS cluster is private - name: Is private cluster id: isPrivate + if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} run: | result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster") echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT" @@ -131,5 +135,10 @@ jobs: - name: Deploy application on public cluster if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' - run: helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace + run: | + if [ "${{ env.CLUSTER_RESOURCE_TYPE }}" == "Microsoft.ContainerService/fleets" ]; then + helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + else + helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace + fi `}} diff --git a/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml b/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml index 1988e233..673dc85d 100644 --- a/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml +++ b/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml @@ -20,8 +20,9 @@ # - ACR_RESOURCE_GROUP (resource group of your ACR) # - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR) # - CONTAINER_NAME (name of the container image you would like to push up to your ACR) +# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name) # - CLUSTER_RESOURCE_GROUP (where your cluster is deployed) -# - CLUSTER_NAME (name of your AKS cluster) +# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedCluster') # - DOCKER_FILE (path to your Dockerfile) # - BUILD_CONTEXT_PATH (path to the context of your Dockerfile) # - NAMESPACE (namespace to deploy your application) @@ -45,8 +46,9 @@ env: ACR_RESOURCE_GROUP: {{ .Config.GetVariableValue "ACRRESOURCEGROUP" }} AZURE_CONTAINER_REGISTRY: {{ .Config.GetVariableValue "AZURECONTAINERREGISTRY" }} CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }} - CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }} + CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} + CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} KUSTOMIZE_PATH: {{ .Config.GetVariableValue "KUSTOMIZEPATH" }} DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }} BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }} @@ -101,12 +103,13 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v3 + uses: azure/aks-set-context@v4.0.2 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} admin: 'false' use-kubelogin: 'true' + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} # Runs Kustomize to create manifest files - name: Bake deployment @@ -116,9 +119,9 @@ jobs: kustomizationPath: ${{ env.KUSTOMIZE_PATH }} kubectl-version: latest id: bake - # Checks if the AKS cluster is private - name: Is private cluster + if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} id: isPrivate run: | result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster") @@ -126,7 +129,7 @@ jobs: # Deploys application based on manifest files from previous step - name: Deploy application - uses: Azure/k8s-deploy@v4 + uses: Azure/k8s-deploy@v5.0.1 with: action: deploy manifests: ${{ steps.bake.outputs.manifestsBundle }} @@ -136,4 +139,5 @@ jobs: name: ${{ env.CLUSTER_NAME }} private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }} namespace: ${{ env.NAMESPACE }} + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} `}} diff --git a/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml b/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml index 7e425e79..7914f2d8 100644 --- a/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml +++ b/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml @@ -18,14 +18,14 @@ # 2. Set the following environment variables (or replace the values below): # - ACR_RESOURCE_GROUP (resource group of your ACR) # - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR) +# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name) # - CLUSTER_RESOURCE_GROUP (where your cluster is deployed) -# - CLUSTER_NAME (name of your AKS cluster) +# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters') # - CONTAINER_NAME (name of the container image you would like to push up to your ACR) # - DEPLOYMENT_MANIFEST_PATH (path to the manifest yaml for your deployment) # - DOCKER_FILE (path to your Dockerfile) # - BUILD_CONTEXT_PATH (path to the context of your Dockerfile) # - NAMESPACE (namespace to deploy your application) -# # For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions # For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples # For more options with the actions used below please refer to https://github.com/Azure/login @@ -41,8 +41,9 @@ env: ACR_RESOURCE_GROUP: {{ .Config.GetVariableValue "ACRRESOURCEGROUP" }} AZURE_CONTAINER_REGISTRY: {{ .Config.GetVariableValue "AZURECONTAINERREGISTRY" }} CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }} - CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }} + CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} + CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} DEPLOYMENT_MANIFEST_PATH: {{ .Config.GetVariableValue "DEPLOYMENTMANIFESTPATH" }} DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }} BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }} @@ -97,15 +98,17 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v3 + uses: azure/aks-set-context@v4.0.2 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} admin: 'false' use-kubelogin: 'true' + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} # Checks if the AKS cluster is private - name: Is private cluster + if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} id: isPrivate run: | result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster") @@ -113,7 +116,7 @@ jobs: # Deploys application based on given manifest file - name: Deploys application - uses: Azure/k8s-deploy@v4 + uses: Azure/k8s-deploy@v5.0.1 with: action: deploy manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }} @@ -123,4 +126,5 @@ jobs: name: ${{ env.CLUSTER_NAME }} private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }} namespace: ${{ env.NAMESPACE }} + resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }} `}} \ No newline at end of file From a3118b42766ede5a72d00b835d4f7b8273772143 Mon Sep 17 00:00:00 2001 From: audrastump Date: Thu, 19 Dec 2024 13:13:17 -0800 Subject: [PATCH 2/7] integration test cluster resource type param --- .github/workflows/integration-linux.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/integration-linux.yml diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml new file mode 100644 index 00000000..e69de29b From deb923a3244c1eddf65db9899abb18414326e417 Mon Sep 17 00:00:00 2001 From: audrastump Date: Mon, 30 Dec 2024 12:19:51 -0800 Subject: [PATCH 3/7] removed version patches, updated helm workflow --- .../workflows/azure-kubernetes-service-helm.yml | 16 +++++++++------- .../azure-kubernetes-service-kustomize.yml | 4 ++-- .../workflows/azure-kubernetes-service.yml | 4 ++-- .../templatetests/workflows_github_helm_test.go | 2 +- .../workflows_github_kustomize_test.go | 2 +- .../workflows/azure-kubernetes-service-helm.yml | 17 +++++++++-------- .../azure-kubernetes-service-kustomize.yml | 6 +++--- .../workflows/azure-kubernetes-service.yml | 6 +++--- 8 files changed, 30 insertions(+), 27 deletions(-) diff --git a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml index 2e668ac0..ee8eea28 100644 --- a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -104,7 +104,7 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v4.0.2 + uses: azure/aks-set-context@v4 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} @@ -128,15 +128,17 @@ jobs: result=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id) echo "Helm upgrade result: $result" exitCode=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id --query exitCode -o tsv) + if [ $exitCode -ne 0 ]; then exit $exitCode fi - name: Deploy application on public cluster - if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' + if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' && env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} run: | - if [ "${{ env.CLUSTER_RESOURCE_TYPE }}" == "Microsoft.ContainerService/fleets" ]; then - helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} - else - helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace - fi + helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace + + - name: Deploy application on fleet hub cluster + if: ${{ env.CLUSTER_RESOURCE_TYPE == 'Microsoft.ContainerService/fleets' }} + run: | + helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} diff --git a/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml b/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml index 93a35702..66799304 100644 --- a/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml +++ b/pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml @@ -103,7 +103,7 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v4.0.2 + uses: azure/aks-set-context@v4 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} @@ -129,7 +129,7 @@ jobs: # Deploys application based on manifest files from previous step - name: Deploy application - uses: Azure/k8s-deploy@v5.0.1 + uses: Azure/k8s-deploy@v5 with: action: deploy manifests: ${{ steps.bake.outputs.manifestsBundle }} diff --git a/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml b/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml index 2dc6443c..e5c326d4 100644 --- a/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml +++ b/pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml @@ -98,7 +98,7 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v4.0.2 + uses: azure/aks-set-context@v4 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} @@ -116,7 +116,7 @@ jobs: # Deploys application based on given manifest file - name: Deploys application - uses: Azure/k8s-deploy@v5.0.1 + uses: Azure/k8s-deploy@v5 with: action: deploy manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }} diff --git a/pkg/handlers/templatetests/workflows_github_helm_test.go b/pkg/handlers/templatetests/workflows_github_helm_test.go index 36901e54..cbec3d3f 100644 --- a/pkg/handlers/templatetests/workflows_github_helm_test.go +++ b/pkg/handlers/templatetests/workflows_github_helm_test.go @@ -22,7 +22,7 @@ func TestGitHubWorkflowHelmTemplates(t *testing.T) { "AZURECONTAINERREGISTRY": "testAcr", "CONTAINERNAME": "testContainer", "CLUSTERRESOURCEGROUP": "testClusterRG", - "CLUSTERRESOURCETYPE": "managedClusters", + "CLUSTERRESOURCETYPE": "Microsoft.ContainerService/managedClusters", "CLUSTERNAME": "testCluster", "KUSTOMIZEPATH": "./overlays/production", "DEPLOYMENTMANIFESTPATH": "./manifests", diff --git a/pkg/handlers/templatetests/workflows_github_kustomize_test.go b/pkg/handlers/templatetests/workflows_github_kustomize_test.go index 35ac3f2e..efbf7231 100644 --- a/pkg/handlers/templatetests/workflows_github_kustomize_test.go +++ b/pkg/handlers/templatetests/workflows_github_kustomize_test.go @@ -22,7 +22,7 @@ func TestGitHubWorkflowKustomizeTemplates(t *testing.T) { "AZURECONTAINERREGISTRY": "testAcr", "CONTAINERNAME": "testContainer", "CLUSTERRESOURCEGROUP": "testClusterRG", - "CLUSTERRESOURCETYPE": "managedClusters", + "CLUSTERRESOURCETYPE": "Microsoft.ContainerService/managedClusters", "CLUSTERNAME": "testCluster", "DEPLOYMENTMANIFESTPATH": "./manifests", "DOCKERFILE": "./Dockerfile", diff --git a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml index 6e2f8129..48e9affc 100644 --- a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -47,7 +47,7 @@ env: CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }} CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }} CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} - CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} + CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }} BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }} CHART_PATH: {{ .Config.GetVariableValue "CHARTPATH" }} @@ -104,7 +104,7 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v4.0.2 + uses: azure/aks-set-context@v4 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} @@ -134,11 +134,12 @@ jobs: fi - name: Deploy application on public cluster - if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' + if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' && env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }} run: | - if [ "${{ env.CLUSTER_RESOURCE_TYPE }}" == "Microsoft.ContainerService/fleets" ]; then - helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} - else - helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace - fi + helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace + + - name: Deploy application on fleet hub cluster + if: ${{ env.CLUSTER_RESOURCE_TYPE == 'Microsoft.ContainerService/fleets' }} + run: | + helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} `}} diff --git a/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml b/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml index 673dc85d..3d05ecb7 100644 --- a/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml +++ b/template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml @@ -48,7 +48,7 @@ env: CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }} CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }} CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} - CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} + CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} KUSTOMIZE_PATH: {{ .Config.GetVariableValue "KUSTOMIZEPATH" }} DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }} BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }} @@ -103,7 +103,7 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v4.0.2 + uses: azure/aks-set-context@v4 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} @@ -129,7 +129,7 @@ jobs: # Deploys application based on manifest files from previous step - name: Deploy application - uses: Azure/k8s-deploy@v5.0.1 + uses: Azure/k8s-deploy@v5 with: action: deploy manifests: ${{ steps.bake.outputs.manifestsBundle }} diff --git a/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml b/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml index 7914f2d8..662199f8 100644 --- a/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml +++ b/template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml @@ -43,7 +43,7 @@ env: CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }} CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }} CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }} - CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} + CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }} DEPLOYMENT_MANIFEST_PATH: {{ .Config.GetVariableValue "DEPLOYMENTMANIFESTPATH" }} DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }} BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }} @@ -98,7 +98,7 @@ jobs: # Retrieves your Azure Kubernetes Service cluster's kubeconfig file - name: Get K8s context - uses: azure/aks-set-context@v4.0.2 + uses: azure/aks-set-context@v4 with: resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }} cluster-name: ${{ env.CLUSTER_NAME }} @@ -116,7 +116,7 @@ jobs: # Deploys application based on given manifest file - name: Deploys application - uses: Azure/k8s-deploy@v5.0.1 + uses: Azure/k8s-deploy@v5 with: action: deploy manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }} From 794cf6b52d83faf1b4ba4b87a2aaf959bcd1b5a8 Mon Sep 17 00:00:00 2001 From: audrastump Date: Thu, 2 Jan 2025 07:49:34 -0800 Subject: [PATCH 4/7] changed integration tests --- .github/workflows/integrations-linux.yml | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/integrations-linux.yml diff --git a/.github/workflows/integrations-linux.yml b/.github/workflows/integrations-linux.yml new file mode 100644 index 00000000..f3b0d040 --- /dev/null +++ b/.github/workflows/integrations-linux.yml @@ -0,0 +1,69 @@ +# this file is generated using gen_integration.sh +name: Linux Integration Tests +on: + pull_request: + branches: [main, staging] + workflow_dispatch: +jobs: + build: + name: Build Draft Binary + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: make + run: make + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: helm-skaffold + path: ./test/skaffold.yaml + if-no-files-found: error + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: draft-binary + path: ./draft + if-no-files-found: error + language-integration-test: + name: Matrix + needs: build + strategy: + matrix: + language: ["gomodule"] # we dont actually want a matrix here, so we include cases individually + repo: ["davidgamero/go_echo"] + include: + - language: "go" + repo: "davidgamero/go-echo-no-mod" + - language: "python" + repo: "OliverMKing/flask-hello-world" + - language: "rust" + repo: "OliverMKing/tiny-http-hello-world" + - language: "javascript" + repo: "davidgamero/express-hello-world" + - language: "ruby" + repo: "davidgamero/sinatra-hello-world" + - language: "csharp" + repo: "imiller31/csharp-simple-web-app" + - language: "java" + repo: "imiller31/simple-java-server" + - language: "gradle" + repo: "imiller31/simple-gradle-server" + - language: "swift" + repo: "OliverMKing/swift-hello-world" + - language: "erlang" + repo: "bfoley13/ErlangExample" + - language: "clojure" + repo: "imiller31/clojure-simple-http" + uses: ./.github/workflows/integration-per-language.yml + with: + language: ${{ matrix.language }} + repo: ${{ matrix.repo }} + linux-integration-summary: + name: Linux Integration Summary + needs: language-integration-test + runs-on: ubuntu-latest + steps: + - run: | + echo "Success" From f3e1146cc3e040852f2a042df6d2f0237216f222 Mon Sep 17 00:00:00 2001 From: audrastump Date: Thu, 2 Jan 2025 08:18:37 -0800 Subject: [PATCH 5/7] added cluster name to new integration tests --- .github/workflows/integration-per-language.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 151de875..b635f6ae 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -158,6 +158,7 @@ jobs: --variable CONTAINERNAME=someContainer \ --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ --variable CLUSTERNAME=someAksCluster \ + --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \ --variable DOCKERFILE=./Dockerfile \ --variable BUILDCONTEXTPATH=. \ --variable NAMESPACE=default @@ -331,6 +332,7 @@ jobs: --variable CONTAINERNAME=someContainer \ --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ --variable CLUSTERNAME=someAksCluster \ + --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \ --variable DOCKERFILE=./Dockerfile \ --variable BUILDCONTEXTPATH=. \ --variable NAMESPACE=default @@ -484,7 +486,7 @@ jobs: curl -m 3 $SERVICEIP:${{env.serviceport}} sleep 5 kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type manifests --variable WORKFLOWNAME=someWorkflow --variable BRANCHNAME=main --variable ACRRESOURCEGROUP=someAcrResourceGroup --variable AZURECONTAINERREGISTRY=someRegistry --variable CONTAINERNAME=someContainer --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup --variable CLUSTERNAME=someAksCluster --variable DOCKERFILE=./Dockerfile --variable BUILDCONTEXTPATH=. --variable NAMESPACE=default + - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type manifests --variable WORKFLOWNAME=someWorkflow --variable BRANCHNAME=main --variable ACRRESOURCEGROUP=someAcrResourceGroup --variable AZURECONTAINERREGISTRY=someRegistry --variable CONTAINERNAME=someContainer --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup --variable CLUSTERNAME=someAksCluster --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters --variable DOCKERFILE=./Dockerfile --variable BUILDCONTEXTPATH=. --variable NAMESPACE=default # Validate generated workflow yaml - name: Install action-validator with asdf uses: asdf-vm/actions/install@v1 From 883904380eb588cee5a91f9b390f7b467db5e827 Mon Sep 17 00:00:00 2001 From: audrastump Date: Thu, 2 Jan 2025 11:40:40 -0800 Subject: [PATCH 6/7] removed stale test again --- .github/workflows/integration-linux.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/integration-linux.yml diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml deleted file mode 100644 index e69de29b..00000000 From e6f555e921d034aa53385b726b75023b42e01638 Mon Sep 17 00:00:00 2001 From: audrastump Date: Thu, 2 Jan 2025 11:50:40 -0800 Subject: [PATCH 7/7] removed more stale tests --- .github/workflows/integrations-linux.yml | 69 ------------------------ 1 file changed, 69 deletions(-) delete mode 100644 .github/workflows/integrations-linux.yml diff --git a/.github/workflows/integrations-linux.yml b/.github/workflows/integrations-linux.yml deleted file mode 100644 index f3b0d040..00000000 --- a/.github/workflows/integrations-linux.yml +++ /dev/null @@ -1,69 +0,0 @@ -# this file is generated using gen_integration.sh -name: Linux Integration Tests -on: - pull_request: - branches: [main, staging] - workflow_dispatch: -jobs: - build: - name: Build Draft Binary - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - - name: make - run: make - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: helm-skaffold - path: ./test/skaffold.yaml - if-no-files-found: error - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: draft-binary - path: ./draft - if-no-files-found: error - language-integration-test: - name: Matrix - needs: build - strategy: - matrix: - language: ["gomodule"] # we dont actually want a matrix here, so we include cases individually - repo: ["davidgamero/go_echo"] - include: - - language: "go" - repo: "davidgamero/go-echo-no-mod" - - language: "python" - repo: "OliverMKing/flask-hello-world" - - language: "rust" - repo: "OliverMKing/tiny-http-hello-world" - - language: "javascript" - repo: "davidgamero/express-hello-world" - - language: "ruby" - repo: "davidgamero/sinatra-hello-world" - - language: "csharp" - repo: "imiller31/csharp-simple-web-app" - - language: "java" - repo: "imiller31/simple-java-server" - - language: "gradle" - repo: "imiller31/simple-gradle-server" - - language: "swift" - repo: "OliverMKing/swift-hello-world" - - language: "erlang" - repo: "bfoley13/ErlangExample" - - language: "clojure" - repo: "imiller31/clojure-simple-http" - uses: ./.github/workflows/integration-per-language.yml - with: - language: ${{ matrix.language }} - repo: ${{ matrix.repo }} - linux-integration-summary: - name: Linux Integration Summary - needs: language-integration-test - runs-on: ubuntu-latest - steps: - - run: | - echo "Success"