-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
the github action that executes cloud deployment tests (#3549)
* 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
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
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
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 |