From e002ba4b6faff55829ae39be9f124076f07f3eb6 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 12 Dec 2024 17:49:53 -0500 Subject: [PATCH 01/35] reusable workflow for helm integrations --- .github/workflows/integration-linux.yml | 5310 +---------------- .../workflows/integration-per-language.yml | 185 + 2 files changed, 193 insertions(+), 5302 deletions(-) create mode 100644 .github/workflows/integration-per-language.yml diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 9165d7ff..6fb3e6f4 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -2,7 +2,7 @@ name: draft Linux Integrations on: pull_request: - branches: [ main, staging ] + branches: [main, staging] workflow_dispatch: jobs: build: @@ -25,5304 +25,10 @@ jobs: name: draft-binary path: ./draft if-no-files-found: error - - gomodule-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: gambtho/go_echo - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/gomodule/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l gomodule --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - gomodule-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: gomodule-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: gambtho/go_echo - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/gomodule/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - gomodule-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: gambtho/go_echo - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/gomodule/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l gomodule --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - gomodule-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: gomodule-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: gambtho/go_echo - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/gomodule/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - gomodule-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: gambtho/go_echo - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/gomodule/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l gomodule --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - gomodule-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: gomodule-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: gambtho/go_echo - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/gomodule/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: gomodule-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - gomodule-manifest-update: - needs: gomodule-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: gomodule-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - go-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/go-echo-no-mod - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/go/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l go --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - go-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: go-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/go-echo-no-mod - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/go/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:8080 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - go-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/go-echo-no-mod - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/go/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l go --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - go-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: go-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/go-echo-no-mod - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/go/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:8080 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - go-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/go-echo-no-mod - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/go/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l go --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - go-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: go-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/go-echo-no-mod - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/go/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:8080 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: go-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - go-manifest-update: - needs: go-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: go-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - python-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/flask-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/python/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l python --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest --variable ENTRYPOINT=testapp.py - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - python-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: python-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/flask-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/python/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - python-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/flask-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/python/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l python --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest --variable ENTRYPOINT=testapp.py - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - python-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: python-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/flask-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/python/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - python-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/flask-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/python/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l python --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest --variable ENTRYPOINT=testapp.py - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - python-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: python-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/flask-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/python/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: python-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - python-manifest-update: - needs: python-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: python-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - rust-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/tiny-http-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/rust/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l rust --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - rust-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: rust-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/tiny-http-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/rust/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - rust-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/tiny-http-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/rust/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l rust --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - rust-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: rust-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/tiny-http-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/rust/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - rust-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/tiny-http-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/rust/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l rust --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - rust-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: rust-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/tiny-http-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/rust/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: rust-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - rust-manifest-update: - needs: rust-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: rust-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - javascript-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/express-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/javascript/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l javascript --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - javascript-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: javascript-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/express-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/javascript/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - javascript-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/express-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/javascript/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l javascript --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - javascript-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: javascript-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/express-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/javascript/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - javascript-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/express-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/javascript/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l javascript --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - javascript-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: javascript-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/express-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/javascript/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: javascript-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - javascript-manifest-update: - needs: javascript-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: javascript-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - ruby-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/sinatra-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/ruby/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l ruby --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - ruby-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: ruby-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/sinatra-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/ruby/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - ruby-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/sinatra-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/ruby/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l ruby --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - ruby-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: ruby-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/sinatra-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/ruby/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - ruby-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/sinatra-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/ruby/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l ruby --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - ruby-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: ruby-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: davidgamero/sinatra-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/ruby/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: ruby-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - ruby-manifest-update: - needs: ruby-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: ruby-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - csharp-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/csharp-simple-web-app - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/csharp/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l csharp --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - csharp-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: csharp-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/csharp-simple-web-app - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/csharp/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - csharp-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/csharp-simple-web-app - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/csharp/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l csharp --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - csharp-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: csharp-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/csharp-simple-web-app - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/csharp/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - csharp-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/csharp-simple-web-app - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/csharp/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l csharp --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - csharp-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: csharp-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/csharp-simple-web-app - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/csharp/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: csharp-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - csharp-manifest-update: - needs: csharp-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: csharp-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - java-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-java-server - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/java/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l java --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - java-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: java-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-java-server - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/java/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - java-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-java-server - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/java/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l java --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - java-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: java-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-java-server - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/java/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - java-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-java-server - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/java/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l java --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - java-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: java-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-java-server - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/java/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: java-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - java-manifest-update: - needs: java-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: java-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - gradle-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-gradle-server - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/gradle/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l gradle --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - gradle-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: gradle-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-gradle-server - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/gradle/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - gradle-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-gradle-server - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/gradle/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l gradle --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - gradle-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: gradle-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-gradle-server - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/gradle/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - gradle-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-gradle-server - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/gradle/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l gradle --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - gradle-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: gradle-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/simple-gradle-server - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/gradle/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: gradle-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - gradle-manifest-update: - needs: gradle-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: gradle-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - swift-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/swift-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/swift/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l swift --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - swift-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: swift-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/swift-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/swift/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - swift-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/swift-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/swift/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l swift --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - swift-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: swift-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/swift-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/swift/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - swift-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/swift-hello-world - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/swift/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l swift --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - swift-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: swift-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: OliverMKing/swift-hello-world - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/swift/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: swift-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - swift-manifest-update: - needs: swift-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: swift-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - erlang-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: bfoley13/ErlangExample - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/erlang/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l erlang --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - erlang-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: erlang-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: bfoley13/ErlangExample - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/erlang/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - erlang-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: bfoley13/ErlangExample - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/erlang/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l erlang --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - erlang-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: erlang-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: bfoley13/ErlangExample - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/erlang/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - erlang-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: bfoley13/ErlangExample - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/erlang/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l erlang --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - erlang-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: erlang-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: bfoley13/ErlangExample - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/erlang/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: erlang-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - erlang-manifest-update: - needs: erlang-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: erlang-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - clojure-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/clojure-simple-http - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/clojure/helm.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l clojure --skip-file-detection --deploy-type helm --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - clojure-helm-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: clojure-helm-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/clojure-simple-http - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/clojure/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - clojure-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/clojure-simple-http - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/clojure/kustomize.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l clojure --skip-file-detection --deploy-type kustomize --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - clojure-kustomize-create-update: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: clojure-kustomize-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/clojure-simple-http - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/clojure/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.10 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: ${{ steps.bake.outputs.manifestsBundle }} - images: | - host.minikube.internal:5001/testapp - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - clojure-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/clojure-simple-http - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -c ./test/integration/clojure/manifest.yaml -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json create -d ./langtest/ -l clojure --skip-file-detection --deploy-type manifests --variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - clojure-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: clojure-manifest-dry-run - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v4 - with: - repository: imiller31/clojure-simple-http - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/clojure/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo "127.0.0.1 docker.local" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval $(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp host.minikube.internal:5001/testapp - echo -n "verifying images:" - docker images - docker push host.minikube.internal:5001/testapp - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=$! - sleep 120 - kubectl get svc - SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: $SERVICEIP" - echo 'Curling service IP' - curl -m 3 $SERVICEIP:80 - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: clojure-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - clojure-manifest-update: - needs: clojure-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: clojure-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ -a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1 - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval $(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n verifying images: - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6 - - helm-integrations-summary: - runs-on: ubuntu-latest - needs: [ gomodule-helm-create-update,go-helm-create-update,python-helm-create-update,rust-helm-create-update,javascript-helm-create-update,ruby-helm-create-update,csharp-helm-create-update,java-helm-create-update,gradle-helm-create-update,swift-helm-create-update,erlang-helm-create-update,clojure-helm-create-update ] - steps: - - run: echo helm integrations passed - - - kustomize-integrations-summary: - runs-on: ubuntu-latest - needs: [ gomodule-kustomize-create-update,go-kustomize-create-update,python-kustomize-create-update,rust-kustomize-create-update,javascript-kustomize-create-update,ruby-kustomize-create-update,csharp-kustomize-create-update,java-kustomize-create-update,gradle-kustomize-create-update,swift-kustomize-create-update,erlang-kustomize-create-update,clojure-kustomize-create-update ] - steps: - - run: echo kustomize integrations passed - - - manifest-integrations-summary: - runs-on: ubuntu-latest - needs: [ gomodule-manifest-update,go-manifest-update,python-manifest-update,rust-manifest-update,javascript-manifest-update,ruby-manifest-update,csharp-manifest-update,java-manifest-update,gradle-manifest-update,swift-manifest-update,erlang-manifest-update,clojure-manifest-update ] - steps: - - run: echo manifest integrations passed - + language-integration-test: + strategy: + matrix: + language: ["gomodule","go"] + uses: ./.github/workflows/integration-per-language.yml + with: + language: ${{ matrix.language }} diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml new file mode 100644 index 00000000..033494ef --- /dev/null +++ b/.github/workflows/integration-per-language.yml @@ -0,0 +1,185 @@ +name: Integration Test for a Single Language +on: + workflow_call: + inputs: + language: + description: "The language to test" + required: true + type: string +jobs: + helm-dry-run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - run: | + echo "repo=$(cat ./test/integration_config.json | jq '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" + - uses: actions/checkout@v3 + with: + repository: ${{ env.repo }} + path: ./langtest + - name: Execute Dry Run with config file + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + create -c ./test/integration/${{inputs.language}}/helm.yaml \ + -d ./langtest/ --skip-file-detection + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json + - name: Execute Dry Run with variables passed through flag + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + create + -d ./langtest/ \ + -l ${{inputs.language}} \ + --skip-file-detection \ + --deploy-type helm \ + --variable PORT=8080 \ + --variable APPNAME=testingCreateCommand \ + --variable VERSION=1.11 \ + --variable BUILDERVERSION=1.11 \ + --variable SERVICEPORT=8080 \ + --variable NAMESPACE=testNamespace \ + --variable IMAGENAME=testImage \ + --variable IMAGETAG=latest \ + --variable ENTRYPOINT=myapp.py + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json + helm-create-update: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5001:5000 + needs: helm-dry-run + env: + imagename: registry:5001/testapp + serviceport: 80 + ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - run: | + echo "repo=$(cat ./test/integration_config.json | jq '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" + - uses: actions/checkout@v3 + with: + repository: ${{ inputs.repo}} + path: ./langtest + - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore + - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ + - name: start minikube + id: minikube + uses: medyagh/setup-minikube@master + with: + insecure-registry: "host.minikube.internal:5001,10.0.0.0/24" + # Runs Helm to create manifest files + - name: Bake deployment + uses: azure/k8s-bake@v2.2 + with: + renderEngine: "helm" + helmChart: ./langtest/charts + overrideFiles: ./langtest/charts/values.yaml + overrides: | + replicas:2 + helm-version: "latest" + releaseName: "test-release" + id: bake + - name: Build and Push image + continue-on-error: true + run: | + export SHELL=/bin/bash + eval \$(minikube -p minikube docker-env) + docker build -f ./langtest/Dockerfile -t testapp ./langtest/ + docker tag testapp ${{env.imagename}} + echo -n \"verifying images:\" + docker images + docker push ${{env.imagename}} + echo 'Curling host.minikube.internal test app images from minikube' + minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" + # Deploys application based on manifest files from previous step + - name: Deploy application + uses: Azure/k8s-deploy@v4.0 + continue-on-error: true + id: deploy + with: + action: deploy + manifests: \${{ steps.bake.outputs.manifestsBundle }} + images: | + ${{env.imagename}} + - name: Wait for rollout + continue-on-error: true + id: rollout + run: | + kubectl rollout status deployment/test-release-testapp --timeout=2m + - name: Print K8s Objects + run: | + kubectl get po -o json + kubectl get svc -o json + kubectl get deploy -o json + - name: Curl Endpoint + run: | + kubectl get svc + echo 'Starting minikube tunnel' + minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! + sleep 120 + kubectl get svc + SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) + echo \"SERVICEIP: \$SERVICEIP\" + echo 'Curling service IP' + curl -m 3 \$SERVICEIP:${{env.serviceport}} + kill \$tunnelPID + - run: | + ./draft -v generate-workflow \ + -d ./langtest/ \ + --deploy-type helm \ + --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 + pwd + # Validate generated workflow yaml + - name: Install action-validator with asdf + uses: asdf-vm/actions/install@v1 + with: + tool_versions: | + action-validator 0.1.2 + - name: Lint Actions + run: | + find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ + | xargs -I {} action-validator --verbose {} + - name: Execute dry run for update command + run: | + mkdir -p test/temp + pwd + ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ ${{ env.ingress_test_args }} + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json + - run: ./draft -v update -d ./langtest/ ${{ env.ingress_test_args }} + - name: Fail if any error + if: steps.deploy.outcome != 'success' + run: | + kubectl get po + echo "Deployment failed, check above logs and previous steps to isolate the issue" + exit 6 From 9872ebe84d1208b36ed97ee252f0c87285b11b44 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 12 Dec 2024 17:51:19 -0500 Subject: [PATCH 02/35] matrix needs build --- .github/workflows/integration-linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 6fb3e6f4..03f74d59 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -26,9 +26,10 @@ jobs: path: ./draft if-no-files-found: error language-integration-test: + needs: build strategy: matrix: - language: ["gomodule","go"] + language: ["gomodule", "go"] uses: ./.github/workflows/integration-per-language.yml with: language: ${{ matrix.language }} From 6c1ca60699048f1393b7f66c483f030c12fd2743 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 12 Dec 2024 17:54:31 -0500 Subject: [PATCH 03/35] jq -raw --- .github/workflows/integration-per-language.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 033494ef..864aec21 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -17,7 +17,7 @@ jobs: - run: chmod +x ./draft - run: mkdir ./langtest - run: | - echo "repo=$(cat ./test/integration_config.json | jq '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" + echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: repository: ${{ env.repo }} @@ -74,7 +74,7 @@ jobs: - run: chmod +x ./draft - run: mkdir ./langtest - run: | - echo "repo=$(cat ./test/integration_config.json | jq '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" + echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: repository: ${{ inputs.repo}} From 57f07d10b71d4e11fcdf43cfbcc219171c0f3b16 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 12 Dec 2024 17:59:11 -0500 Subject: [PATCH 04/35] create command missing cmd newline --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 864aec21..baa6e251 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -36,7 +36,7 @@ jobs: run: | mkdir -p test/temp ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create + create \ -d ./langtest/ \ -l ${{inputs.language}} \ --skip-file-detection \ From 189497046808df31a62520d86d18e7d64678686a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 12 Dec 2024 18:08:34 -0500 Subject: [PATCH 05/35] use repo input --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index baa6e251..7b46d4aa 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -77,7 +77,7 @@ jobs: echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: - repository: ${{ inputs.repo}} + repository: ${{ env.repo }} path: ./langtest - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ From d8ee868d93ad0d31601dd813f276bafe5f170275 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 12 Dec 2024 18:15:41 -0500 Subject: [PATCH 06/35] remove residual bash escapes --- .github/workflows/integration-per-language.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 7b46d4aa..889c0307 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -102,14 +102,14 @@ jobs: continue-on-error: true run: | export SHELL=/bin/bash - eval \$(minikube -p minikube docker-env) + eval $(minikube -p minikube docker-env) docker build -f ./langtest/Dockerfile -t testapp ./langtest/ docker tag testapp ${{env.imagename}} - echo -n \"verifying images:\" + echo -n "verifying images:" docker images docker push ${{env.imagename}} echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" + minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list\" # Deploys application based on manifest files from previous step - name: Deploy application uses: Azure/k8s-deploy@v4.0 @@ -137,11 +137,11 @@ jobs: minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! sleep 120 kubectl get svc - SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo \"SERVICEIP: \$SERVICEIP\" + SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) + echo "SERVICEIP: \$SERVICEIP" echo 'Curling service IP' - curl -m 3 \$SERVICEIP:${{env.serviceport}} - kill \$tunnelPID + curl -m 3 $SERVICEIP:${{env.serviceport}} + kill $tunnelPID - run: | ./draft -v generate-workflow \ -d ./langtest/ \ From f279b672dd7c669ef6a75790c7aa840f4d6b335c Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 14:11:55 -0500 Subject: [PATCH 07/35] bump k8s bake --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 889c0307..9a21d7f4 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -88,7 +88,7 @@ jobs: insecure-registry: "host.minikube.internal:5001,10.0.0.0/24" # Runs Helm to create manifest files - name: Bake deployment - uses: azure/k8s-bake@v2.2 + uses: azure/k8s-bake@v3.0.1 with: renderEngine: "helm" helmChart: ./langtest/charts From 7947d2cb68d86822fafa3d33a1e327e6972c2dd7 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 14:13:49 -0500 Subject: [PATCH 08/35] escape on k8s-deploy --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 9a21d7f4..3eb8308a 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -117,7 +117,7 @@ jobs: id: deploy with: action: deploy - manifests: \${{ steps.bake.outputs.manifestsBundle }} + manifests: ${{ steps.bake.outputs.manifestsBundle }} images: | ${{env.imagename}} - name: Wait for rollout From 0f8df64dd4b02a57ca33bf30b6caaed624d68c49 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 14:23:01 -0500 Subject: [PATCH 09/35] use language input --- .github/workflows/integration-per-language.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 3eb8308a..33116a70 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -17,7 +17,7 @@ jobs: - run: chmod +x ./draft - run: mkdir ./langtest - run: | - echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" + echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == ${{ inputs.language }}) | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: repository: ${{ env.repo }} @@ -74,7 +74,7 @@ jobs: - run: chmod +x ./draft - run: mkdir ./langtest - run: | - echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == "go") | .repo')" >> "$GITHUB_ENV" + echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == ${{ inputs.language }}) | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: repository: ${{ env.repo }} From 7d98734540405dcd16cf2632e35936828f6301ca Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 14:28:42 -0500 Subject: [PATCH 10/35] more shell escapes --- .github/workflows/integration-per-language.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 33116a70..52800879 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -109,7 +109,7 @@ jobs: docker images docker push ${{env.imagename}} echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list\" + minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" # Deploys application based on manifest files from previous step - name: Deploy application uses: Azure/k8s-deploy@v4.0 @@ -134,11 +134,11 @@ jobs: run: | kubectl get svc echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! + minikube tunnel > /dev/null 2>&1 & tunnelPID=$! sleep 120 kubectl get svc SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo "SERVICEIP: \$SERVICEIP" + echo "SERVICEIP: $SERVICEIP" echo 'Curling service IP' curl -m 3 $SERVICEIP:${{env.serviceport}} kill $tunnelPID From a2cbcb31aca712c8fb77de1adbd99dc27a691b85 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 14:37:56 -0500 Subject: [PATCH 11/35] remove existing charts/overlays --- .github/workflows/integration-per-language.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 52800879..8d3da208 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -79,7 +79,12 @@ jobs: with: repository: ${{ env.repo }} path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore + - run: | + rm -rf ./langtest/manifests + rm -f ./langtest/Dockerfile ./langtest/.dockerignore + rm -rf ./langtest/charts + rm -rf ./langtest/base + rm -rf ./langtest/overlays - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ - name: start minikube id: minikube From 69712c9af2cfa9707a1f26556c3bee3961a7f6ef Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 14:47:27 -0500 Subject: [PATCH 12/35] skip file detection --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 8d3da208..d18d73ed 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -85,7 +85,7 @@ jobs: rm -rf ./langtest/charts rm -rf ./langtest/base rm -rf ./langtest/overlays - - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ + - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ --skip-file-detection - name: start minikube id: minikube uses: medyagh/setup-minikube@master From a25d6bd9021e1c4e0d4e4929645a7c5415d9c820 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 15:23:45 -0500 Subject: [PATCH 13/35] make repo a param for matrix --- .github/workflows/integration-linux.yml | 9 ++++++++- .github/workflows/integration-per-language.yml | 13 ++++++------- template/deployments/helm/draft.yaml | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 03f74d59..36b7ae6c 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -29,7 +29,14 @@ jobs: needs: build strategy: matrix: - language: ["gomodule", "go"] + language: [] + repo: [] + include: + - language: "gomodule" + repo: "gambtho/go_echo" + - language: "go" + repo: "davidgamero/go-echo-no-mod" uses: ./.github/workflows/integration-per-language.yml with: language: ${{ matrix.language }} + repo: ${{ matrix.repo }} diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index d18d73ed..f13c939f 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -6,6 +6,10 @@ on: description: "The language to test" required: true type: string + repo: + description: "The repo to test" + required: true + type: string jobs: helm-dry-run: runs-on: ubuntu-latest @@ -16,11 +20,9 @@ jobs: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - run: | - echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == ${{ inputs.language }}) | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: - repository: ${{ env.repo }} + repository: ${{ inputs.repo }} path: ./langtest - name: Execute Dry Run with config file run: | @@ -73,11 +75,9 @@ jobs: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - run: | - echo "repo=$(cat ./test/integration_config.json | jq -r '.[] | select(.language == ${{ inputs.language }}) | .repo')" >> "$GITHUB_ENV" - uses: actions/checkout@v3 with: - repository: ${{ env.repo }} + repository: ${{ inputs.repo }} path: ./langtest - run: | rm -rf ./langtest/manifests @@ -104,7 +104,6 @@ jobs: releaseName: "test-release" id: bake - name: Build and Push image - continue-on-error: true run: | export SHELL=/bin/bash eval $(minikube -p minikube docker-env) diff --git a/template/deployments/helm/draft.yaml b/template/deployments/helm/draft.yaml index 4265fedc..0df4f479 100644 --- a/template/deployments/helm/draft.yaml +++ b/template/deployments/helm/draft.yaml @@ -154,7 +154,7 @@ variables: kind: "kubernetesProbeDelay" default: disablePrompt: true - value: 5 + value: 10 description: "kubernetes startup probe initial delay in seconds" versions: ">=0.0.1" - name: "READINESSPERIOD" From 4c82053aa8ca0dd1007ca9822cc4336bb0338e9a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 15:28:56 -0500 Subject: [PATCH 14/35] add to matrix --- .github/workflows/integration-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 36b7ae6c..2eb276b1 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -29,8 +29,8 @@ jobs: needs: build strategy: matrix: - language: [] - repo: [] + language: ["gomodule"] + repo: ["gambtho/go_echo"] include: - language: "gomodule" repo: "gambtho/go_echo" From 3bd620d8cd5b81c21fbf47474d80e4d224e3e2cd Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 15:46:53 -0500 Subject: [PATCH 15/35] external build image name --- .github/workflows/integration-per-language.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index f13c939f..42512e39 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -108,10 +108,10 @@ jobs: export SHELL=/bin/bash eval $(minikube -p minikube docker-env) docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp ${{env.imagename}} + docker tag testapp host.minikube.internal:5001/testapp echo -n "verifying images:" docker images - docker push ${{env.imagename}} + docker push host.minikube.internal:5001/testapp echo 'Curling host.minikube.internal test app images from minikube' minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" # Deploys application based on manifest files from previous step From 77006ef4a60406225fbff245cc088bfacf24414d Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 16:32:48 -0500 Subject: [PATCH 16/35] port 80 for servies --- test/integration/go/helm.yaml | 2 +- test/integration/go/kustomize.yaml | 2 +- test/integration/go/manifest.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/go/helm.yaml b/test/integration/go/helm.yaml index 6fad23ec..bee83908 100644 --- a/test/integration/go/helm.yaml +++ b/test/integration/go/helm.yaml @@ -5,7 +5,7 @@ deployVariables: - name: "PORT" value: "8080" - name: "SERVICEPORT" - value: "8080" + value: "80" - name: "APPNAME" value: "testapp" - name: "IMAGENAME" diff --git a/test/integration/go/kustomize.yaml b/test/integration/go/kustomize.yaml index 96d99bfe..9f1eb38f 100644 --- a/test/integration/go/kustomize.yaml +++ b/test/integration/go/kustomize.yaml @@ -5,7 +5,7 @@ deployVariables: - name: "PORT" value: "8080" - name: "SERVICEPORT" - value: "8080" + value: "80" - name: "APPNAME" value: "testapp" - name: "IMAGENAME" diff --git a/test/integration/go/manifest.yaml b/test/integration/go/manifest.yaml index fa4e13aa..719fd6f9 100644 --- a/test/integration/go/manifest.yaml +++ b/test/integration/go/manifest.yaml @@ -5,7 +5,7 @@ deployVariables: - name: "PORT" value: "8080" - name: "SERVICEPORT" - value: "8080" + value: "80" - name: "APPNAME" value: "testapp" - name: "IMAGENAME" From b3f2a151fcea3fd36c54c954fe9f0df2ef4ced6e Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 16:44:01 -0500 Subject: [PATCH 17/35] validate generated actions --- .github/workflows/integration-per-language.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 42512e39..82e194eb 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -145,6 +145,7 @@ jobs: echo "SERVICEIP: $SERVICEIP" echo 'Curling service IP' curl -m 3 $SERVICEIP:${{env.serviceport}} + sleep 5 kill $tunnelPID - run: | ./draft -v generate-workflow \ @@ -169,7 +170,7 @@ jobs: action-validator 0.1.2 - name: Lint Actions run: | - find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ + find ./langtest/.github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ | xargs -I {} action-validator --verbose {} - name: Execute dry run for update command run: | From 9e89313dd8b3cc1d333854565a3258c7d9e59d29 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 16:53:31 -0500 Subject: [PATCH 18/35] switch to davidgamero go echo fork --- .github/workflows/integration-linux.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 2eb276b1..ab52df70 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -30,10 +30,8 @@ jobs: strategy: matrix: language: ["gomodule"] - repo: ["gambtho/go_echo"] + repo: ["davidgamero/go_echo"] include: - - language: "gomodule" - repo: "gambtho/go_echo" - language: "go" repo: "davidgamero/go-echo-no-mod" uses: ./.github/workflows/integration-per-language.yml From bd21d34c4a5502e97b1992228ebb6ba839d75886 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 17:36:39 -0500 Subject: [PATCH 19/35] kustomize workflow --- .../workflows/integration-per-language.yml | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 82e194eb..e2be95b8 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -188,3 +188,173 @@ jobs: kubectl get po echo "Deployment failed, check above logs and previous steps to isolate the issue" exit 6 + kustomize-dry-run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v3 + with: + repository: ${{ inputs.repo }} + path: ./langtest + - name: Execute Dry Run with config file + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + create -c ./test/integration/${{inputs.language}}/kustomize.yaml \ + -d ./langtest/ --skip-file-detection + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json + - name: Execute Dry Run with variables passed through flag + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + create \ + -d ./langtest/ \ + -l ${{inputs.language}} \ + --skip-file-detection \ + --deploy-type kustomize \ + --variable PORT=8080 \ + --variable APPNAME=testingCreateCommand \ + --variable VERSION=1.11 \ + --variable BUILDERVERSION=1.11 \ + --variable SERVICEPORT=8080 \ + --variable NAMESPACE=testNamespace \ + --variable IMAGENAME=testImage \ + --variable IMAGETAG=latest \ + + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json + kustomize-create-update: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5001:5000 + needs: kustomize-dry-run + env: + imagename: registry:5001/testapp + serviceport: 80 + ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v3 + with: + repository: ${{inputs.repo}} + path: ./langtest + - run: | + rm -rf ./langtest/manifests + rm -f ./langtest/Dockerfile ./langtest/.dockerignore + rm -rf ./langtest/charts + rm -rf ./langtest/base + rm -rf ./langtest/overlays + - run: ./draft -v create -c ./test/integration/${{inputs.language}}/kustomize.yaml -d ./langtest/ + - name: start minikube + id: minikube + uses: medyagh/setup-minikube@master + with: + insecure-registry: "host.minikube.internal:5001,10.0.0.0/24" + - name: Bake deployment + uses: azure/k8s-bake@v3.0.1 + id: bake + with: + renderEngine: "kustomize" + kustomizationPath: ./langtest/base + kubectl-version: "latest" + - name: Build and Push Image + continue-on-error: true + run: | + export SHELL=/bin/bash + eval $(minikube -p minikube docker-env) + docker build -f ./langtest/Dockerfile -t testapp ./langtest/ + docker tag testapp host.minikube.internal:5001/testapp + echo -n "verifying images:" + docker images + docker push host.minikube.internal:5001/testapp + echo 'Curling host.minikube.internal test app images from minikube' + minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" + # Deploys application based on manifest files from previous step + - name: Deploy application + uses: Azure/k8s-deploy@v4.0 + continue-on-error: true + id: deploy + with: + action: deploy + manifests: ${{ steps.bake.outputs.manifestsBundle }} + images: | + ${{env.imagename}} + - name: Wait for rollout + continue-on-error: true + id: rollout + run: | + kubectl rollout status deployment/testapp --timeout=2m + - name: Print K8s Objects + run: | + kubectl get po -o json + kubectl get svc -o json + kubectl get deploy -o json + - name: Curl Endpoint + run: | + kubectl get svc + echo 'Starting minikube tunnel' + minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! + sleep 120 + kubectl get svc + SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) + echo \"SERVICEIP: \$SERVICEIP\" + echo 'Curling service IP' + curl -m 3 \$SERVICEIP:$serviceport + kill \$tunnelPID + - run: | + ./draft -v generate-workflow \ + -d ./langtest/ \ + --deploy-type kustomize \ + --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 + pwd + # Validate generated workflow yaml + - name: Install action-validator with asdf + uses: asdf-vm/actions/install@v1 + with: + tool_versions: | + action-validator 0.1.2 + - name: Lint Actions + run: | + find ./langtest/.github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ + | xargs -I {} action-validator --verbose {} + - name: Execute dry run for update command + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json + - run: ./draft -v update -d ./langtest/ $ingress_test_args + - name: Check default namespace + if: steps.deploy.outcome != 'success' + run: | + kubectl get po + echo "Deployment failed, check above logs and previous steps to isolate the issue" From eafeb271fd7f976a14284d70ff8f4552cd59c5cd Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 17:46:08 -0500 Subject: [PATCH 20/35] fix minikube tunnel --- .github/workflows/integration-per-language.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index e2be95b8..6cc3b2bc 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -311,14 +311,15 @@ jobs: run: | kubectl get svc echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! + minikube tunnel > /dev/null 2>&1 & tunnelPID=$! sleep 120 kubectl get svc - SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo \"SERVICEIP: \$SERVICEIP\" + SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) + echo "SERVICEIP: $SERVICEIP" echo 'Curling service IP' - curl -m 3 \$SERVICEIP:$serviceport - kill \$tunnelPID + curl -m 3 $SERVICEIP:${{env.serviceport}} + sleep 5 + kill $tunnelPID - run: | ./draft -v generate-workflow \ -d ./langtest/ \ From 0939a614a66ef1215c56ce203553e0cc0d7c004e Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 13 Dec 2024 18:11:34 -0500 Subject: [PATCH 21/35] add manifest reusable workflow --- .../workflows/integration-per-language.yml | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 6cc3b2bc..08e582c2 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -359,3 +359,197 @@ jobs: run: | kubectl get po echo "Deployment failed, check above logs and previous steps to isolate the issue" + manifests-dry-run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v3 + with: + repository: ${{ inputs.repo }} + path: ./langtest + - name: Execute Dry Run with config file + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + create -c ./test/integration/$lang/manifest.yaml \ + -d ./langtest/ --skip-file-detection + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json + - name: Execute Dry Run with variables passed through flag + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + create \ + -d ./langtest/ \ + -l ${{inputs.language}} \ + --skip-file-detection \ + --deploy-type manifests\ + --variable PORT=8080 \ + --variable APPNAME=testingCreateCommand \ + --variable VERSION=1.11 \ + --variable BUILDERVERSION=1.11 \ + --variable SERVICEPORT=8080 \ + --variable NAMESPACE=testNamespace \ + --variable IMAGENAME=testImage \ + --variable IMAGETAG=latest \ + --variable ENTRYPOINT=myapp.py + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json + manifests-create: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5001:5000 + needs: manifests-dry-run + env: + imagename: registry:5001/testapp + serviceport: 80 + ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v3 + with: + repository: ${{ inputs.repo }} + path: ./langtest + - run: | + rm -rf ./langtest/manifests + rm -f ./langtest/Dockerfile ./langtest/.dockerignore + rm -rf ./langtest/charts + rm -rf ./langtest/base + rm -rf ./langtest/overlays + - run: ./draft -v create -c ./test/integration/$lang/manifest.yaml -d ./langtest/ + - name: print manifests + run: cat ./langtest/manifests/* + - name: Add docker.local host to /etc/hosts + run: | + sudo echo \"127.0.0.1 docker.local\" | sudo tee -a /etc/hosts + - name: start minikube + id: minikube + uses: medyagh/setup-minikube@master + with: + insecure-registry: "host.minikube.internal:5001,10.0.0.0/24" + - name: Build and Push Image + continue-on-error: true + run: | + eval \$(minikube docker-env) + docker build -f ./langtest/Dockerfile -t testapp ./langtest/ + docker tag testapp $imagename + echo -n \"verifying images:\" + docker images + docker push $imagename + echo 'Curling host.minikube.internal test app images from minikube' + minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" + # Deploys application based on manifest files from previous step + - name: Deploy application + run: kubectl apply -f ./langtest/manifests/ + continue-on-error: true + id: deploy + - name: Wait for rollout + continue-on-error: true + id: rollout + run: | + kubectl rollout status deployment/testapp --timeout=2m + - name: Print K8s Objects + run: | + kubectl get po -o json + kubectl get svc -o json + kubectl get deploy -o json + - name: Curl Endpoint + run: | + kubectl get svc + echo 'Starting minikube tunnel' + minikube tunnel > /dev/null 2>&1 & tunnelPID=$! + sleep 120 + kubectl get svc + SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) + echo "SERVICEIP: $SERVICEIP" + echo 'Curling service IP' + 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 + # Validate generated workflow yaml + - name: Install action-validator with asdf + uses: asdf-vm/actions/install@v1 + with: + tool_versions: | + action-validator 0.1.2 + - name: Lint Actions + run: | + find ./langtest/.github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ + | xargs -I {} action-validator --verbose {} + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: $lang-manifests-create + path: | + ./langtest + !./langtest/**/.git/* + - name: Fail if any error + if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' + run: exit 6 + manifest_update_job_name: + needs: manifests-create + runs-on: ubuntu-latest + env: + ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: draft-binary + - run: chmod +x ./draft + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: $lang-manifests-create + path: ./langtest/ + - name: Execute dry run for update command + run: | + mkdir -p test/temp + ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args + - name: Validate JSON + run: | + npm install -g ajv-cli@5.0.0 + ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json + - run: ./draft -v update -d ./langtest/ ${{ env.ingress_test_args }} + - name: start minikube + id: minikube + uses: medyagh/setup-minikube@master + - name: Build image + run: | + export SHELL=/bin/bash + eval $(minikube -p minikube docker-env) + docker build -f ./langtest/Dockerfile -t testapp ./langtest/ + echo -n "verifying images:" + docker images + # Deploys application based on manifest files from previous step + - name: Deploy application + run: kubectl apply -f ./langtest/manifests/ + continue-on-error: true + id: deploy + - name: Fail if any error + if: steps.deploy.outcome != 'success' + run: | + kubectl get po + echo "Deployment failed, check above logs and previous steps to isolate the issue" + exit 6 From db2096401c83b204077434184ed69c105812b18c Mon Sep 17 00:00:00 2001 From: David Gamero Date: Sat, 14 Dec 2024 16:22:17 -0500 Subject: [PATCH 22/35] language var --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 08e582c2..15821b70 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -376,7 +376,7 @@ jobs: run: | mkdir -p test/temp ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -c ./test/integration/$lang/manifest.yaml \ + create -c ./test/integration/${{inputs.language}}/manifest.yaml \ -d ./langtest/ --skip-file-detection - name: Validate JSON run: | From 220eb3dd335edee31d9d71871606dd584573335b Mon Sep 17 00:00:00 2001 From: David Gamero Date: Mon, 16 Dec 2024 14:42:40 -0500 Subject: [PATCH 23/35] revert startup delay --- template/deployments/helm/draft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/deployments/helm/draft.yaml b/template/deployments/helm/draft.yaml index 0df4f479..4265fedc 100644 --- a/template/deployments/helm/draft.yaml +++ b/template/deployments/helm/draft.yaml @@ -154,7 +154,7 @@ variables: kind: "kubernetesProbeDelay" default: disablePrompt: true - value: 10 + value: 5 description: "kubernetes startup probe initial delay in seconds" versions: ">=0.0.1" - name: "READINESSPERIOD" From 198a0ef2ccfd7e7333027446fc693abbdb27faf7 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Tue, 17 Dec 2024 16:27:39 -0500 Subject: [PATCH 24/35] verbose on manifest output --- .github/workflows/integration-per-language.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 15821b70..75da6c32 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -385,7 +385,7 @@ jobs: - name: Execute Dry Run with variables passed through flag run: | mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ + ./draft -v --dry-run --dry-run-file test/temp/dry-run.json \ create \ -d ./langtest/ \ -l ${{inputs.language}} \ @@ -395,7 +395,7 @@ jobs: --variable APPNAME=testingCreateCommand \ --variable VERSION=1.11 \ --variable BUILDERVERSION=1.11 \ - --variable SERVICEPORT=8080 \ + --variable SERVICEPORT=80 \ --variable NAMESPACE=testNamespace \ --variable IMAGENAME=testImage \ --variable IMAGETAG=latest \ From 57fdc8e53352e4d468983d09437bcf0226b29808 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Tue, 17 Dec 2024 17:40:31 -0500 Subject: [PATCH 25/35] extra space --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 75da6c32..9ad746cb 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -390,7 +390,7 @@ jobs: -d ./langtest/ \ -l ${{inputs.language}} \ --skip-file-detection \ - --deploy-type manifests\ + --deploy-type manifests \ --variable PORT=8080 \ --variable APPNAME=testingCreateCommand \ --variable VERSION=1.11 \ From 10249b4463ac8a5772b645ac24f69051c5a95c65 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Tue, 17 Dec 2024 19:12:58 -0500 Subject: [PATCH 26/35] switch to gh vars for lang in manifest create --- .../workflows/integration-per-language.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 9ad746cb..0d8a582d 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -433,7 +433,7 @@ jobs: rm -rf ./langtest/charts rm -rf ./langtest/base rm -rf ./langtest/overlays - - run: ./draft -v create -c ./test/integration/$lang/manifest.yaml -d ./langtest/ + - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ --skip-file-detection - name: print manifests run: cat ./langtest/manifests/* - name: Add docker.local host to /etc/hosts @@ -447,14 +447,15 @@ jobs: - name: Build and Push Image continue-on-error: true run: | - eval \$(minikube docker-env) + export SHELL=/bin/bash + eval $(minikube -p minikube docker-env) docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp $imagename - echo -n \"verifying images:\" + docker tag testapp host.minikube.internal:5001/testapp + echo -n "verifying images:" docker images - docker push $imagename + docker push host.minikube.internal:5001/testapp echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" + minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" # Deploys application based on manifest files from previous step - name: Deploy application run: kubectl apply -f ./langtest/manifests/ @@ -496,7 +497,7 @@ jobs: | xargs -I {} action-validator --verbose {} - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: - name: $lang-manifests-create + name: ${{inputs.language}}-manifests-create path: | ./langtest !./langtest/**/.git/* @@ -521,12 +522,12 @@ jobs: - run: chmod +x ./draft - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: - name: $lang-manifests-create + name: ${{inputs.language}}-manifests-create path: ./langtest/ - name: Execute dry run for update command run: | mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args + ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ ${{env.ingress_test_args}} - name: Validate JSON run: | npm install -g ajv-cli@5.0.0 From 477b9ed92a2a9cc215f31a6b9293e732fb2edefe Mon Sep 17 00:00:00 2001 From: David Gamero Date: Tue, 17 Dec 2024 19:18:30 -0500 Subject: [PATCH 27/35] fix helm->manifest --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 0d8a582d..d7ed8219 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -433,7 +433,7 @@ jobs: rm -rf ./langtest/charts rm -rf ./langtest/base rm -rf ./langtest/overlays - - run: ./draft -v create -c ./test/integration/${{inputs.language}}/helm.yaml -d ./langtest/ --skip-file-detection + - run: ./draft -v create -c ./test/integration/${{inputs.language}}/manifest.yaml -d ./langtest/ --skip-file-detection - name: print manifests run: cat ./langtest/manifests/* - name: Add docker.local host to /etc/hosts From 19f8d0e6e12fccdd90cf369ccd401799201277b8 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Dec 2024 12:33:32 -0500 Subject: [PATCH 28/35] version bumps --- .github/workflows/integration-linux.yml | 10 ++++- .../workflows/integration-per-language.yml | 42 +++++++++---------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index ab52df70..f8bd079d 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -1,11 +1,12 @@ # this file is generated using gen_integration.sh -name: draft Linux Integrations +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 @@ -26,6 +27,7 @@ jobs: path: ./draft if-no-files-found: error language-integration-test: + name: Language/DeployType Matrix needs: build strategy: matrix: @@ -38,3 +40,9 @@ jobs: with: language: ${{ matrix.language }} repo: ${{ matrix.repo }} + linux-integration-summary: + needs: language-integration-test + name: Linux Integration Summary + steps: + run: | + echo "Success" diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index d7ed8219..336019fe 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -14,13 +14,13 @@ jobs: helm-dry-run: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ inputs.repo }} path: ./langtest @@ -69,13 +69,13 @@ jobs: serviceport: 80 ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ inputs.repo }} path: ./langtest @@ -191,13 +191,13 @@ jobs: kustomize-dry-run: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ inputs.repo }} path: ./langtest @@ -246,13 +246,13 @@ jobs: serviceport: 80 ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{inputs.repo}} path: ./langtest @@ -362,13 +362,13 @@ jobs: manifests-dry-run: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ inputs.repo }} path: ./langtest @@ -417,13 +417,13 @@ jobs: serviceport: 80 ingress_test_args: "-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: draft-binary - run: chmod +x ./draft - run: mkdir ./langtest - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ inputs.repo }} path: ./langtest @@ -495,7 +495,7 @@ jobs: run: | find ./langtest/.github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \ | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + - uses: actions/upload-artifact@v4 with: name: ${{inputs.language}}-manifests-create path: | @@ -515,12 +515,12 @@ jobs: ports: - 5000:5000 steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: draft-binary - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/download-artifact@v4 with: name: ${{inputs.language}}-manifests-create path: ./langtest/ From bd3e725a9c62aba887d0474d601e48765e6ec585 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Dec 2024 12:37:02 -0500 Subject: [PATCH 29/35] uses --- .github/workflows/integration-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index f8bd079d..a818f37c 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -44,5 +44,5 @@ jobs: needs: language-integration-test name: Linux Integration Summary steps: - run: | + - run: | echo "Success" From 7ff2d53293dbf334832bc0d9f9fda0a5ba90fe39 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Dec 2024 12:38:04 -0500 Subject: [PATCH 30/35] indent --- .github/workflows/integration-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index a818f37c..45811757 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -45,4 +45,4 @@ jobs: name: Linux Integration Summary steps: - run: | - echo "Success" + echo "Success" From 29568626d6289af1530a9cb55a43ee1e3bf4d13c Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Dec 2024 12:39:53 -0500 Subject: [PATCH 31/35] runs on --- .github/workflows/integration-linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 45811757..83d112c1 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -41,8 +41,9 @@ jobs: language: ${{ matrix.language }} repo: ${{ matrix.repo }} linux-integration-summary: - needs: language-integration-test name: Linux Integration Summary + needs: language-integration-test + runs-on: ubuntu-latest steps: - run: | echo "Success" From 7489eaf521f2455d3266f077637b280c13a70ae5 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Dec 2024 12:56:13 -0500 Subject: [PATCH 32/35] add all repos --- .github/workflows/integration-linux.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml index 83d112c1..f3b0d040 100644 --- a/.github/workflows/integration-linux.yml +++ b/.github/workflows/integration-linux.yml @@ -27,15 +27,35 @@ jobs: path: ./draft if-no-files-found: error language-integration-test: - name: Language/DeployType Matrix + name: Matrix needs: build strategy: matrix: - language: ["gomodule"] + 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 }} From 0584546acd5ba9ca77500e73d4a0dec096166e66 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Dec 2024 13:27:53 -0500 Subject: [PATCH 33/35] python entrypoint --- .github/workflows/integration-per-language.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 336019fe..5bc3dd85 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -228,7 +228,7 @@ jobs: --variable NAMESPACE=testNamespace \ --variable IMAGENAME=testImage \ --variable IMAGETAG=latest \ - + --variable ENTRYPOINT=myapp.py - name: Validate JSON run: | npm install -g ajv-cli@5.0.0 From f9b10e42877ab70b1d930e61760a1d028177d969 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Mon, 30 Dec 2024 12:22:40 -0500 Subject: [PATCH 34/35] use new workflow file to clean up diff --- .../workflows/{integration-linux.yml => integrations-linux.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{integration-linux.yml => integrations-linux.yml} (100%) diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integrations-linux.yml similarity index 100% rename from .github/workflows/integration-linux.yml rename to .github/workflows/integrations-linux.yml From 71ba9d1a7ae2f8caba8c37080d8d223bfdf6317d Mon Sep 17 00:00:00 2001 From: David Gamero Date: Mon, 30 Dec 2024 12:25:44 -0500 Subject: [PATCH 35/35] remove generation --- Makefile | 10 +- test/gen_integration.sh | 823 ----------------------------------- test/integration_config.json | 93 ---- 3 files changed, 2 insertions(+), 924 deletions(-) delete mode 100755 test/gen_integration.sh delete mode 100644 test/integration_config.json diff --git a/Makefile b/Makefile index 06deb0e1..cef5ccac 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: all -all: build generate-integrations +all: build .PHONY: test @@ -14,12 +14,6 @@ run-unit-tests: run-e2e-tests-local: build test/check_info_schema.sh; -.PHONY: generate-integrations -generate-integrations: - cd ./test; \ - ./gen_integration.sh; \ - cd ..; - .PHONY: build build: GO111MODULE=on go build -v -o . @@ -56,4 +50,4 @@ clean-entra-app: else \ az ad app delete --id $$APP_ID_TO_DELETE; \ echo "Deleted Azure entra application with display name: $$APP_DISPLAY_NAME"; \ - fi \ No newline at end of file + fi diff --git a/test/gen_integration.sh b/test/gen_integration.sh deleted file mode 100755 index ef46c187..00000000 --- a/test/gen_integration.sh +++ /dev/null @@ -1,823 +0,0 @@ -export WORKFLOWS_PATH=.github/workflows - -# remove previous tests -echo "Removing previous integration configs" -rm -rf ./integration/* -echo "Removing previous integration workflows" -rm ../$WORKFLOWS_PATH/integration-linux.yml -rm ../$WORKFLOWS_PATH/integration-windows.yml - -# create temp files for keeping track off workflow jobs to build job-dependency graph -# this is used to populated the needs: field of the required final workflow jobs -helm_workflow_names_file=./temp/helm_workflow_names.txt -rm $helm_workflow_names_file -helm_win_workflow_names_file=./temp/helm_win_workflow_names.txt -rm $helm_win_workflow_names_file -kustomize_workflow_names_file=./temp/kustomize_workflow_names.txt -rm $kustomize_workflow_names_file -kustomize_win_workflow_names_file=./temp/kustomize_win_workflow_names.txt -rm $kustomize_win_workflow_names_file -manifest_workflow_names_file=./temp/manifest_workflow_names.txt -rm $manifest_workflow_names_file -mkdir -p ./temp - -# add build to workflow -echo "# this file is generated using gen_integration.sh -name: draft Linux Integrations -on: - pull_request: - branches: [ main, staging ] - workflow_dispatch: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v4 - 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" > ../$WORKFLOWS_PATH/integration-linux.yml - -echo "name: draft Windows Integrations -on: - pull_request: - branches: [ main, staging ] - workflow_dispatch: -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.22 - - name: make - run: make - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: draft-binary - path: ./draft.exe - if-no-files-found: error - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: check_windows_helm - path: ./test/check_windows_helm.ps1 - if-no-files-found: error - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: check_windows_addon_helm - path: ./test/check_windows_addon_helm.ps1 - if-no-files-found: error - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: check_windows_kustomize - path: ./test/check_windows_kustomize.ps1 - if-no-files-found: error - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: check_windows_addon_kustomize - path: ./test/check_windows_addon_kustomize.ps1 - if-no-files-found: error" > ../$WORKFLOWS_PATH/integration-windows.yml - - -# read config and add integration test for each language -cat integration_config.json | jq -c '.[]' | while read -r test; -do - note="# this file is generated using gen_integration.sh" - # extract from json - lang=$(echo $test | jq '.language' -r) - version=$(echo $test | jq '.version' -r) - builderversion=$(echo $test | jq '.builderversion' -r) - port=$(echo $test | jq '.port' -r) - serviceport=$(echo $test | jq '.serviceport' -r) - repo=$(echo $test | jq '.repo' -r) - startupInitialDelay=$(echo $test | jq '.startupInitialDelay' -r) - startupInitialDelaySegment="" - # if startupinitialdelay is empty - if [ "$startupInitialDelay" != "null" ]; then - startupInitialDelaySegment=" - - name: \"STARTUPINITIALDELAY\" - value: $startupInitialDelay" - fi - - imagename="host.minikube.internal:5001/testapp" - # addon integration testing vars - ingress_test_args="-a webapp_routing --variable ingress-tls-cert-keyvault-uri=test.cert.keyvault.uri --variable ingress-use-osm-mtls=true --variable ingress-host=host1" - create_config_args="--variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest" - python_create_config_args="--variable PORT=8080 --variable APPNAME=testingCreateCommand --variable VERSION=1.11 --variable BUILDERVERSION=1.11 --variable SERVICEPORT=8080 --variable NAMESPACE=testNamespace --variable IMAGENAME=testImage --variable IMAGETAG=latest --variable ENTRYPOINT=testapp.py" - echo "Adding $lang with port $port" - - mkdir ./integration/$lang - - # create helm.yaml - echo "$note -deployType: \"Helm\" -languageType: \"$lang\" -deployVariables: - - name: \"PORT\" - value: \"$port\" - - name: \"SERVICEPORT\" - value: \"$serviceport\" - - name: \"APPNAME\" - value: \"testapp\" - - name: \"IMAGENAME\" - value: \"$imagename\"$startupInitialDelaySegment -languageVariables: - - name: \"VERSION\" - value: \"$version\" - - name: \"BUILDERVERSION\" - value: \"$builderversion\" - - name: \"PORT\" - value: \"$port\"" > ./integration/$lang/helm.yaml - - # create kustomize.yaml - echo "$note -deployType: \"kustomize\" -languageType: \"$lang\" -deployVariables: - - name: \"PORT\" - value: \"$port\" - - name: \"SERVICEPORT\" - value: \"$serviceport\" - - name: \"APPNAME\" - value: \"testapp\" - - name: \"IMAGENAME\" - value: \"$imagename\"$startupInitialDelaySegment -languageVariables: - - name: \"VERSION\" - value: \"$version\" - - name: \"BUILDERVERSION\" - value: \"$builderversion\" - - name: \"PORT\" - value: \"$port\"" > ./integration/$lang/kustomize.yaml - - # create manifest.yaml - echo "$note -deployType: \"manifests\" -languageType: \"$lang\" -deployVariables: - - name: \"PORT\" - value: \"$port\" - - name: \"SERVICEPORT\" - value: \"$serviceport\" - - name: \"APPNAME\" - value: \"testapp\" - - name: \"IMAGENAME\" - value: \"$imagename\"$startupInitialDelaySegment -languageVariables: - - name: \"VERSION\" - value: \"$version\" - - name: \"BUILDERVERSION\" - value: \"$builderversion\" - - name: \"PORT\" - value: \"$port\"" > ./integration/$lang/manifest.yaml - - # create helm workflow - helm_create_update_job_name=$lang-helm-create-update - echo $helm_create_update_job_name >> $helm_workflow_names_file - echo " - $lang-helm-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -c ./test/integration/$lang/helm.yaml \ - -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - $(if [ "$lang" = "python" ] - then echo "run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -d ./langtest/ -l $lang --skip-file-detection --deploy-type helm \ - $python_create_config_args" - else echo "run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -d ./langtest/ -l $lang --skip-file-detection --deploy-type helm \ - $create_config_args" - fi) - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - $helm_create_update_job_name: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: $lang-helm-dry-run - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/$lang/helm.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - # Runs Helm to create manifest files - - name: Bake deployment - uses: azure/k8s-bake@v2.2 - with: - renderEngine: 'helm' - helmChart: ./langtest/charts - overrideFiles: ./langtest/charts/values.yaml - overrides: | - replicas:2 - helm-version: 'latest' - releaseName: 'test-release' - id: bake - - name: Build and Push image - continue-on-error: true - run: | - export SHELL=/bin/bash - eval \$(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp $imagename - echo -n \"verifying images:\" - docker images - docker push $imagename - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.0 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: \${{ steps.bake.outputs.manifestsBundle }} - images: | - $imagename - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/test-release-testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! - sleep 120 - kubectl get svc - SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo \"SERVICEIP: \$SERVICEIP\" - echo 'Curling service IP' - curl -m 3 \$SERVICEIP:$serviceport - kill \$tunnelPID - - run: | - ./draft -v generate-workflow -d ./langtest/ --deploy-type helm --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 - pwd - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v1 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find $WORKFLOWS_PATH -type f \( -iname \*.yaml -o -iname \*.yml \) \ - | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - pwd - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ $ingress_test_args - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6" >> ../$WORKFLOWS_PATH/integration-linux.yml - - # create kustomize workflow - kustomize_create_update_job_name=$lang-kustomize-create-update - echo $kustomize_create_update_job_name >> $kustomize_workflow_names_file - echo " - $lang-kustomize-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -c ./test/integration/$lang/kustomize.yaml \ - -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - $(if [ "$lang" = "python" ]; - then echo "run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -d ./langtest/ -l $lang --skip-file-detection --deploy-type kustomize \ - $python_create_config_args"; - else echo "run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -d ./langtest/ -l $lang --skip-file-detection --deploy-type kustomize \ - $create_config_args"; - fi) - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - $kustomize_create_update_job_name: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: $lang-kustomize-dry-run - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/$lang/kustomize.yaml -d ./langtest/ - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Bake deployment - uses: azure/k8s-bake@v2.4 - id: bake - with: - renderEngine: 'kustomize' - kustomizationPath: ./langtest/base - kubectl-version: 'latest' - - name: Build and Push Image - continue-on-error: true - run: | - eval \$(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp $imagename - echo -n \"verifying images:\" - docker images - docker push $imagename - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" - # Deploys application based on manifest files from previous step - - name: Deploy application - uses: Azure/k8s-deploy@v4.0 - continue-on-error: true - id: deploy - with: - action: deploy - manifests: \${{ steps.bake.outputs.manifestsBundle }} - images: | - $imagename - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! - sleep 120 - kubectl get svc - SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo \"SERVICEIP: \$SERVICEIP\" - echo 'Curling service IP' - curl -m 3 \$SERVICEIP:$serviceport - kill \$tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type kustomize --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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v1 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find $WORKFLOWS_PATH -type f \( -iname \*.yaml -o -iname \*.yml \) \ - | xargs -I {} action-validator --verbose {} - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ $ingress_test_args - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6" >> ../$WORKFLOWS_PATH/integration-linux.yml - - # create manifests workflow - manifest_update_job_name=$lang-manifest-update - echo $manifest_update_job_name >> $manifest_workflow_names_file - echo " - $lang-manifest-dry-run: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - name: Execute Dry Run with config file - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -c ./test/integration/$lang/manifest.yaml \ - -d ./langtest/ --skip-file-detection - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - - name: Execute Dry Run with variables passed through flag - $(if [ "$lang" = "python" ]; - then echo "run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -d ./langtest/ -l $lang --skip-file-detection --deploy-type manifests \ - $python_create_config_args"; - else echo "run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/dry-run.json \ - create -d ./langtest/ -l $lang --skip-file-detection --deploy-type manifests \ - $create_config_args"; - fi) - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/dry_run_schema.json -d test/temp/dry-run.json - $lang-manifests-create: - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5001:5000 - needs: $lang-manifest-dry-run - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - run: rm -rf ./langtest/manifests && rm -f ./langtest/Dockerfile ./langtest/.dockerignore - - run: ./draft -v create -c ./test/integration/$lang/manifest.yaml -d ./langtest/ - - name: print manifests - run: cat ./langtest/manifests/* - - name: Add docker.local host to /etc/hosts - run: | - sudo echo \"127.0.0.1 docker.local\" | sudo tee -a /etc/hosts - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - with: - insecure-registry: 'host.minikube.internal:5001,10.0.0.0/24' - - name: Build and Push Image - continue-on-error: true - run: | - eval \$(minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - docker tag testapp $imagename - echo -n \"verifying images:\" - docker images - docker push $imagename - echo 'Curling host.minikube.internal test app images from minikube' - minikube ssh \"curl http://host.minikube.internal:5001/v2/testapp/tags/list\" - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Wait for rollout - continue-on-error: true - id: rollout - run: | - kubectl rollout status deployment/testapp --timeout=2m - - name: Print K8s Objects - run: | - kubectl get po -o json - kubectl get svc -o json - kubectl get deploy -o json - - name: Curl Endpoint - run: | - kubectl get svc - echo 'Starting minikube tunnel' - minikube tunnel > /dev/null 2>&1 & tunnelPID=\$! - sleep 120 - kubectl get svc - SERVICEIP=\$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) - echo \"SERVICEIP: \$SERVICEIP\" - echo 'Curling service IP' - curl -m 3 \$SERVICEIP:$serviceport - 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 - # Validate generated workflow yaml - - name: Install action-validator with asdf - uses: asdf-vm/actions/install@v1 - with: - tool_versions: | - action-validator 0.1.2 - - name: Lint Actions - run: | - find $WORKFLOWS_PATH -type f \( -iname \*.yaml -o -iname \*.yml \) \ - | xargs -I {} action-validator --verbose {} - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: $lang-manifests-create - path: | - ./langtest - !./langtest/**/.git/* - - name: Fail if any error - if: steps.deploy.outcome != 'success' || steps.rollout.outcome != 'success' - run: exit 6 - $manifest_update_job_name: - needs: $lang-manifests-create - runs-on: ubuntu-latest - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: chmod +x ./draft - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: $lang-manifests-create - path: ./langtest/ - - name: Execute dry run for update command - run: | - mkdir -p test/temp - ./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args - - name: Validate JSON - run: | - npm install -g ajv-cli@5.0.0 - ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json - - run: ./draft -v update -d ./langtest/ $ingress_test_args - - name: start minikube - id: minikube - uses: medyagh/setup-minikube@master - - name: Build image - run: | - export SHELL=/bin/bash - eval \$(minikube -p minikube docker-env) - docker build -f ./langtest/Dockerfile -t testapp ./langtest/ - echo -n "verifying images:" - docker images - # Deploys application based on manifest files from previous step - - name: Deploy application - run: kubectl apply -f ./langtest/manifests/ - continue-on-error: true - id: deploy - - name: Check default namespace - if: steps.deploy.outcome != 'success' - run: kubectl get po - - name: Fail if any error - if: steps.deploy.outcome != 'success' - run: exit 6" >> ../$WORKFLOWS_PATH/integration-linux.yml - - helm_update_win_jobname=$lang-helm-update - echo $helm_update_win_jobname >> $helm_win_workflow_names_file - # create helm workflow - echo " - $lang-helm-create: - runs-on: windows-latest - needs: build - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - run: Remove-Item ./langtest/manifests -Recurse -Force -ErrorAction Ignore - - run: Remove-Item ./langtest/Dockerfile -ErrorAction Ignore - - run: Remove-Item ./langtest/.dockerignore -ErrorAction Ignore - - run: ./draft.exe -v create -c ./test/integration/$lang/helm.yaml -d ./langtest/ - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: check_windows_helm - path: ./langtest/ - - run: ./check_windows_helm.ps1 - working-directory: ./langtest/ - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: $lang-helm-create - path: | - ./langtest - !./langtest/**/.git/* - $helm_update_win_jobname: - needs: $lang-helm-create - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: $lang-helm-create - path: ./langtest/ - - run: Remove-Item ./langtest/charts/templates/ingress.yaml -Recurse -Force -ErrorAction Ignore - - run: ./draft.exe -v update -d ./langtest/ $ingress_test_args - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: check_windows_addon_helm - path: ./langtest/ - - run: ./check_windows_addon_helm.ps1 - working-directory: ./langtest/" >> ../$WORKFLOWS_PATH/integration-windows.yml - - # create kustomize workflow - kustomize_win_workflow_name=$lang-kustomize-update - echo $kustomize_win_workflow_name >> $kustomize_win_workflow_names_file - echo " - $lang-kustomize-create: - runs-on: windows-latest - needs: build - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - run: mkdir ./langtest - - uses: actions/checkout@v3 - with: - repository: $repo - path: ./langtest - - run: Remove-Item ./langtest/manifests -Recurse -Force -ErrorAction Ignore - - run: Remove-Item ./langtest/Dockerfile -ErrorAction Ignore - - run: Remove-Item ./langtest/.dockerignore -ErrorAction Ignore - - run: ./draft.exe -v create -c ./test/integration/$lang/kustomize.yaml -d ./langtest/ - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: check_windows_kustomize - path: ./langtest/ - - run: ./check_windows_kustomize.ps1 - working-directory: ./langtest/ - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: $lang-kustomize-create - path: | - ./langtest - !./langtest/**/.git/* - $kustomize_win_workflow_name: - needs: $lang-kustomize-create - runs-on: windows-latest - steps: - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: draft-binary - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: $lang-kustomize-create - path: ./langtest - - run: Remove-Item ./langtest/overlays/production/ingress.yaml -ErrorAction Ignore - - run: ./draft.exe -v update -d ./langtest/ $ingress_test_args - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: check_windows_addon_kustomize - path: ./langtest/ - - run: ./check_windows_addon_kustomize.ps1 - working-directory: ./langtest/ - " >> ../$WORKFLOWS_PATH/integration-windows.yml -done - -echo " - helm-win-integrations-summary: - runs-on: windows-latest - needs: [ $( paste -sd ',' $helm_win_workflow_names_file) ] - steps: - - run: echo "helm integrations passed" -" >> ../$WORKFLOWS_PATH/integration-windows.yml - -echo " - kustomize-win-integrations-summary: - runs-on: windows-latest - needs: [ $( paste -sd ',' $kustomize_win_workflow_names_file) ] - steps: - - run: echo "kustomize integrations passed" -" >> ../$WORKFLOWS_PATH/integration-windows.yml - -echo " - helm-integrations-summary: - runs-on: ubuntu-latest - needs: [ $( paste -sd ',' $helm_workflow_names_file) ] - steps: - - run: echo "helm integrations passed" -" >> ../$WORKFLOWS_PATH/integration-linux.yml - -echo " - kustomize-integrations-summary: - runs-on: ubuntu-latest - needs: [ $( paste -sd ',' $kustomize_workflow_names_file) ] - steps: - - run: echo "kustomize integrations passed" -" >> ../$WORKFLOWS_PATH/integration-linux.yml - -echo " - manifest-integrations-summary: - runs-on: ubuntu-latest - needs: [ $( paste -sd ',' $manifest_workflow_names_file) ] - steps: - - run: echo "manifest integrations passed" -" >> ../$WORKFLOWS_PATH/integration-linux.yml \ No newline at end of file diff --git a/test/integration_config.json b/test/integration_config.json deleted file mode 100644 index 08ed96e7..00000000 --- a/test/integration_config.json +++ /dev/null @@ -1,93 +0,0 @@ -[ - { - "language": "gomodule", - "version": "1.22.0", - "port": "1323", - "serviceport": 80, - "repo": "gambtho/go_echo" - }, - { - "language": "go", - "version": "1.22.0", - "port": "8080", - "serviceport": 8080, - "repo": "davidgamero/go-echo-no-mod" - }, - { - "language": "python", - "version": "3", - "port": "5000", - "serviceport": 80, - "repo": "OliverMKing/flask-hello-world" - }, - { - "language": "rust", - "version": "1.77.0", - "port": "8000", - "serviceport": 80, - "repo": "OliverMKing/tiny-http-hello-world" - }, - { - "language": "javascript", - "version": "14", - "port": "1313", - "serviceport": 80, - "repo": "davidgamero/express-hello-world" - }, - { - "language": "ruby", - "version": "3.1.2", - "port": "4567", - "serviceport": 80, - "repo": "davidgamero/sinatra-hello-world" - }, - { - "language": "csharp", - "version": "5.0", - "port": "80", - "serviceport": 80, - "repo": "imiller31/csharp-simple-web-app" - }, - { - "language": "java", - "version": "11-jre", - "builderversion": "3-jdk-11", - "port": "8080", - "serviceport": 80, - "repo": "imiller31/simple-java-server", - "startupInitialDelay": 30 - }, - { - "language": "gradle", - "version": "11-jre", - "builderversion": "7-jdk11", - "port": "8080", - "serviceport": 80, - "repo": "imiller31/simple-gradle-server", - "startupInitialDelay": 30 - }, - { - "language": "swift", - "version": "5.5", - "port": "8080", - "serviceport": 80, - "repo": "OliverMKing/swift-hello-world", - "startupInitialDelay": 30 - }, - { - "language": "erlang", - "version": "3.17", - "builderversion": "27.0-alpine", - "port": "8080", - "serviceport": 80, - "repo": "bfoley13/ErlangExample" - }, - { - "language": "clojure", - "version": "8-jdk-alpine", - "port": "8080", - "serviceport": 80, - "repo": "imiller31/clojure-simple-http", - "startupInitialDelay": 30 - } -] \ No newline at end of file