Github Actions #5
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
name: CI | |
on: | |
- pull_request | |
jobs: | |
job1: | |
runs-on: ubuntu-latest | |
name: Deploy to minikube | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Start minikube | |
uses: medyagh/setup-minikube@master | |
- name: Try the cluster ! | |
run: kubectl get pods -A | |
- name: Deploy KubePlus to minikube | |
run: | | |
export SHELL=/bin/bash | |
wget https://get.helm.sh/helm-v3.12.1-linux-amd64.tar.gz | |
gunzip helm-v3.12.1-linux-amd64.tar.gz | |
tar -xvf helm-v3.12.1-linux-amd64.tar | |
sudo mv linux-amd64/helm /usr/local/bin/. | |
export KUBEPLUS_HOME=`pwd` | |
export PATH=$KUBEPLUS_HOME/plugins:$PATH | |
echo "PATH:$PATH" | |
echo "KUBEPLUS_HOME:$KUBEPLUS_HOME" | |
kubectl kubeplus commands | |
export KUBEPLUS_NS=default | |
python3 -m venv venv | |
source venv/bin/activate | |
pip3 install -r requirements.txt | |
apiserver=`kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'` | |
echo "API_SERVER_URL:$apiserver" | |
python3 provider-kubeconfig.py -s $apiserver create $KUBEPLUS_NS | |
deactivate | |
helm install kubeplus ./deploy/kubeplus-chart --kubeconfig=kubeplus-saas-provider.json -n $KUBEPLUS_NS | |
until kubectl get pods -A | grep kubeplus | grep Running; do echo "Waiting for KubePlus to start.."; sleep 1; done | |
- name: Deploy WordPress application | |
run: | | |
kubectl upload chart wordpress-chart-0.0.3.tgz kubeplus-saas-provider.json | |
kubectl create -f ./examples/multitenancy/application-hosting/wordpress/wordpress-service-composition-localchart.yaml --kubeconfig=kubeplus-saas-provider.json | |
kubectl get resourcecompositions | |
kubectl describe resourcecomposition wordpress-service-composition | |
until kubectl get crds | grep wordpressservices.platformapi.kubeplus; do echo "Waiting for CRD to be registered.."; sleep 1; done | |
kubectl create -f ./examples/multitenancy/application-hosting/wordpress/tenant1.yaml --kubeconfig=kubeplus-saas-provider.json | |
kubectl appresources WordpressService wp-tenant1 –k kubeplus-saas-provider.json | |
kubectl metrics WordpressService wp-tenant1 $KUBEPLUS_NS -k kubeplus-saas-provider.json | |
#eval $(minikube -p minikube docker-env) | |
#docker build -f ./Dockerfile -t local/example . | |
#echo -n "verifying images:" | |
#docker images |