Commit cd5a4c9a authored by sathyaseelan's avatar sathyaseelan Committed by Uday Kiran

Included path reference in to gitlab script (#20)

Signed-off-by: 's avatarsathyaseelan <sathyaseelan.n@cloudbyte.com>
parent e1ad3837
......@@ -12,7 +12,7 @@ stages:
- CLUSTER-CLEANUP
variables:
utils_path: "/openebs/e2e-packet/script/utils"
utils_path: "/builds/openebs/e2e-packet/script/utils"
# Setup the kubernetes cluster
......
#!/bin/bash
set -e
#---------------------Runner Cleanup-----------------------------------
kubectl get po -n gitlab-runner
kubectl get pods -n gitlab-runner -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$(date -d'now-6 hours' -Ins --utc | sed 's/+0000/Z/')'" { print $1 }' | grep "runner.*project-6" | xargs --no-run-if-empty kubectl delete pod -n gitlab-runner
path=$(pwd)
echo "creating packet-cluster"
mkdir -p ~/.kube /openebs/e2e-packet/cluster /openebs/e2e-packet/cluster/ssh /openebs/e2e-packet/cluster/.kube
mkdir -p ~/.kube $path/cluster $path/cluster/ssh $path/cluster/.kube
export PACKET_API_TOKEN=$packet_api_token
git clone https://github.com/openebs/litmus.git
cd litmus/k8s/packet/k8s-installer
......@@ -16,10 +12,11 @@ ansible-playbook create_packet_cluster.yml --extra-vars "k8s_version=1.10.0-00"
kubectl get nodes
kubectl get pods --all-namespaces
kubectl apply -f https://raw.githubusercontent.com/openebs/litmus/master/hack/rbac.yaml
cp -r /tmp/packet/. /openebs/e2e-packet/cluster/
cat ~/.kube/config > /openebs/e2e-packet/cluster/.kube/admin.conf
cp -r ~/.kube/. /openebs/e2e-packet/cluster/.kube/
cp -r ~/.ssh/. /openebs/e2e-packet/cluster/ssh
kubectl create configmap kubeconfig --from-file=/openebs/e2e-packet/cluster/.kube/admin.conf -n litmus
cp -r /tmp/packet/. $path/cluster/
cat ~/.kube/config > $path/cluster/.kube/admin.conf
cp -r ~/.kube/. $path/cluster/.kube/
cp -r ~/.ssh/. $path/cluster/ssh
kubectl create configmap kubeconfig --from-file=$path/cluster/.kube/admin.conf -n litmus
kubectl get pods --all-namespaces
kubectl get nodes
......@@ -2,13 +2,15 @@
set -e
path=$(pwd)
echo "Packet-Cleanup"
mkdir ~/.kube ~/.ssh /tmp/packet
cp -r cluster/.kube/. ~/.kube/
cp -r cluster/ssh/. ~/.ssh/ && eval `ssh-agent -s` && ssh-add
cp cluster/device_id /tmp/packet/
cp -r $path/cluster/.kube/. ~/.kube/
cp -r $path/cluster/ssh/. ~/.ssh/ && eval `ssh-agent -s` && ssh-add
cp $path/cluster/device_id /tmp/packet/
export PACKET_API_TOKEN=$packet_api_token
git clone https://github.com/openebs/litmus.git
cd litmus/k8s/packet/k8s-installer
echo "--------------- deleting packet cluster --------------------"
ansible-playbook delete_packet_cluster.yml -vv
......@@ -3,17 +3,18 @@ set -x
derive_cluster_details_infra()
{
path=$(pwd)
## Get kubeconfig file into infra-setup gitlab runner pod
mkdir ~/.kube openebs-packet openebs-packet/.kube
cp -r cluster/.kube/. ~/.kube/
cp -r cluster/.kube/. openebs-packet/.kube/
mkdir ~/.kube $path/openebs-packet $path/openebs-packet/.kube
cp -r $path/cluster/.kube/. ~/.kube/
cp -r $path/cluster/.kube/. $path/openebs-packet/.kube/
}
setup_cluster_config_test()
{
path=$(pwd)
mkdir ~/.kube
cp -r openebs-packet/.kube/. ~/.kube/
cp -r $path/openebs-packet/.kube/. ~/.kube/
}
if [[ $1 == "infra-setup" ]]; then
......@@ -22,3 +23,4 @@ elif [[ $1 == "litmus-test" ]]; then
setup_cluster_config_test;
else echo "invalid job type"; exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment