diff --git a/.github/workflows/integration-linux.yml b/.github/workflows/integration-linux.yml deleted file mode 100644 index 9165d7ff..00000000 --- a/.github/workflows/integration-linux.yml +++ /dev/null @@ -1,5328 +0,0 @@ -# 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@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - - name: make - run: make - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: helm-skaffold - path: ./test/skaffold.yaml - if-no-files-found: error - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: draft-binary - path: ./draft - if-no-files-found: error - - 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 - diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml new file mode 100644 index 00000000..5bc3dd85 --- /dev/null +++ b/.github/workflows/integration-per-language.yml @@ -0,0 +1,556 @@ +name: Integration Test for a Single Language +on: + workflow_call: + inputs: + language: + 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 + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v4 + 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}}/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@v4 + - uses: actions/download-artifact@v4 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v4 + 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}}/helm.yaml -d ./langtest/ --skip-file-detection + - 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@v3.0.1 + 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 + 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/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}} + sleep 5 + 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 ./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 + 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 + kustomize-dry-run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v4 + 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 \ + --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 + 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@v4 + - uses: actions/download-artifact@v4 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v4 + 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:${{env.serviceport}} + sleep 5 + 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" + manifests-dry-run: + runs-on: ubuntu-latest + 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: ${{ 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}}/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 -v --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=80 \ + --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@v4 + - uses: actions/download-artifact@v4 + with: + name: draft-binary + - run: chmod +x ./draft + - run: mkdir ./langtest + - uses: actions/checkout@v4 + 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}}/manifest.yaml -d ./langtest/ --skip-file-detection + - 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: | + 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 + 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@v4 + with: + name: ${{inputs.language}}-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@v4 + - uses: actions/download-artifact@v4 + with: + name: draft-binary + - run: chmod +x ./draft + - uses: actions/download-artifact@v4 + with: + 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/ ${{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: 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 diff --git a/.github/workflows/integrations-linux.yml b/.github/workflows/integrations-linux.yml new file mode 100644 index 00000000..f3b0d040 --- /dev/null +++ b/.github/workflows/integrations-linux.yml @@ -0,0 +1,69 @@ +# this file is generated using gen_integration.sh +name: Linux Integration Tests +on: + pull_request: + branches: [main, staging] + workflow_dispatch: +jobs: + build: + name: Build Draft Binary + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: make + run: make + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: helm-skaffold + path: ./test/skaffold.yaml + if-no-files-found: error + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: draft-binary + path: ./draft + if-no-files-found: error + language-integration-test: + name: Matrix + needs: build + strategy: + matrix: + language: ["gomodule"] # we dont actually want a matrix here, so we include cases individually + repo: ["davidgamero/go_echo"] + include: + - language: "go" + repo: "davidgamero/go-echo-no-mod" + - language: "python" + repo: "OliverMKing/flask-hello-world" + - language: "rust" + repo: "OliverMKing/tiny-http-hello-world" + - language: "javascript" + repo: "davidgamero/express-hello-world" + - language: "ruby" + repo: "davidgamero/sinatra-hello-world" + - language: "csharp" + repo: "imiller31/csharp-simple-web-app" + - language: "java" + repo: "imiller31/simple-java-server" + - language: "gradle" + repo: "imiller31/simple-gradle-server" + - language: "swift" + repo: "OliverMKing/swift-hello-world" + - language: "erlang" + repo: "bfoley13/ErlangExample" + - language: "clojure" + repo: "imiller31/clojure-simple-http" + uses: ./.github/workflows/integration-per-language.yml + with: + language: ${{ matrix.language }} + repo: ${{ matrix.repo }} + linux-integration-summary: + name: Linux Integration Summary + needs: language-integration-test + runs-on: ubuntu-latest + steps: + - run: | + echo "Success" 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/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" 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