Added SDK calls in tenantID function #754
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this file is generated using gen_integration.sh | |
name: draft Linux Integrations | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
deployments: read | |
packages: none | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.18.2 | |
- name: make | |
run: make | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: helm-skaffold | |
path: ./test/skaffold.yaml | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: gomodule-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: go-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: python-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: rust-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: javascript-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
with: | |
repository: OliverMKing/ruby-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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
with: | |
repository: OliverMKing/ruby-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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
with: | |
repository: OliverMKing/ruby-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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
with: | |
repository: OliverMKing/ruby-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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
with: | |
repository: OliverMKing/ruby-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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
with: | |
repository: OliverMKing/ruby-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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ruby-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: csharp-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: java-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: gradle-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: swift-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: erlang-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.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 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: | | |
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 -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type helm --build-context-path . | |
pwd | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
pwd | |
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ -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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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.0 | |
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 -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer --deploy-type kustomize --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- name: Execute dry run for update command | |
run: | | |
mkdir -p test/temp | |
./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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- run: mkdir ./langtest | |
- uses: actions/checkout@v3 | |
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/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp --deploy-type manifests --build-context-path . | |
# Validate generated workflow yaml | |
- name: Install action-validator with asdf | |
uses: asdf-vm/actions/install@v1 | |
with: | |
tool_versions: | | |
action-validator 0.1.2 | |
- name: Lint Actions | |
run: | | |
find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) | xargs -I {} action-validator --verbose {} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: clojure-manifests-create | |
path: ./langtest | |
- 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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: draft-binary | |
- run: chmod +x ./draft | |
- uses: actions/download-artifact@v3 | |
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 | |