blob: e4f2043d11af8cc698f4142b592a03d6561e7241 [file] [log] [blame]
Alexa0053b92022-10-14 16:38:28 -05001#!/bin/bash
2##
3echo "### Checking rally environments"
4status=$(kubectl -n qa-space get pod | grep rally | tr -s " " | cut -d' ' -f3)
5if [ ${status} != "Running" ]; then
6 echo "# 'rally' container is not Running"
7 exit 1
8fi
9
Ievgeniia Zadorozhna3a526cf2024-01-24 21:03:10 +010010# Updating folder and file permissions
11kubectl exec -n qa-space --stdin rally -- sudo chown rally -R /artifacts
12kubectl exec -n qa-space --stdin rally -- sudo chown rally -R /rally/rally-files/
Alex2c8b8802022-10-20 14:07:15 -050013
Alexa0053b92022-10-14 16:38:28 -050014###
15if [ ! -z $(kubectl exec -n qa-space --stdin rally -- rally env list | grep openstack | cut -d' ' -f2) ]; then
16 echo "# Openstack env already created"
17 kubectl exec -n qa-space --stdin rally -- rally env list
18else
19 echo "# Creating openstack env"
20 kubectl exec -n qa-space --stdin rally -- bash -c "bash /rally/rally-files/init-rally-openstack.sh"
21fi
22echo " "
23###
24if [ ! -z $(kubectl exec -n qa-space --stdin rally -- rally env list | grep kubernetes | cut -d' ' -f2) ]; then
25 echo "# Kubernetes env already created"
26 kubectl exec -n qa-space --stdin rally -- rally env list
27else
28 echo "# Creating kubernetes env"
Alexa0053b92022-10-14 16:38:28 -050029 kubectl cp $MY_PROJFOLDER/envs/mos-kubeconfig.yaml qa-space/rally:/artifacts/mos-kubeconfig.yaml
30 kubectl exec -n qa-space --stdin rally -- bash -c "bash /rally/rally-files/init-rally-kube.sh"
31fi