Skip to content

Commit

Permalink
the github action that executes cloud deployment tests (#3549)
Browse files Browse the repository at this point in the history
* gh actions: the action that executes cloud deployment tests

* gh actions, cloud deployment: add helm into gh actions

* gh actions, cloud deployment: cache maven local rero

* gh actions, cloud deployment: install jetstack repo
  • Loading branch information
xnull committed Mar 20, 2023
1 parent b84ef87 commit e7a44e4
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/cloud-deployment-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Cloud Deployment Test

on: pull_request

jobs:

could-deployment-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v2

- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: build docker image
run: .ci/infrastructure-docker-build.sh docker

- uses: actions/checkout@v2
with:
repository: 'CorfuDB/corfudb-cloud'

- name: install helm package manager
working-directory: ./cloud/corfu
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
helm repo add jetstack https://charts.jetstack.io
helm repo update
- name: Create k3d Cluster
uses: AbsaOSS/k3d-action@v2
with:
cluster-name: "corfu"
args: >-
--volume /tmp/k3dvol:/tmp/k3dvol
--agents 2
--k3s-arg "--no-deploy=traefik,servicelb,metrics-server@server:*"
- name: install corfu package
working-directory: ./cloud/corfu
run: |
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.8.0 --set installCRDs=true
helm install corfu corfu --set persistence.enabled=true --set global.replicas=3
sleep 120
if kubectl wait --for=condition=complete --timeout=180s job/configure-corfu | grep "job.batch/configure-corfu condition met"; then
echo "Successfull deployment!"
exit 0
else
echo "Failed deployment!"
echo pods:
kubectl get pods
echo corfu job:
kubectl describe job/configure-corfu
echo corfu pod:
kubectl describe pod corfu-0
exit 1
fi

0 comments on commit e7a44e4

Please sign in to comment.