Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | ## |
| 3 | echo "### Checking rally environments" |
| 4 | status=$(kubectl -n qa-space get pod | grep rally | tr -s " " | cut -d' ' -f3) |
| 5 | if [ ${status} != "Running" ]; then |
| 6 | echo "# 'rally' container is not Running" |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
Ievgeniia Zadorozhna | 04b546e | 2024-01-24 21:03:10 +0100 | [diff] [blame] | 10 | # Updating folder and file permissions |
| 11 | kubectl exec -n qa-space --stdin rally -- sudo chown rally -R /artifacts |
| 12 | kubectl exec -n qa-space --stdin rally -- sudo chown rally -R /rally/rally-files/ |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 13 | |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 14 | ### |
| 15 | if [ ! -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 |
| 18 | else |
| 19 | echo "# Creating openstack env" |
| 20 | kubectl exec -n qa-space --stdin rally -- bash -c "bash /rally/rally-files/init-rally-openstack.sh" |
| 21 | fi |
| 22 | echo " " |
| 23 | ### |
| 24 | if [ ! -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 |
| 27 | else |
| 28 | echo "# Creating kubernetes env" |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 29 | 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" |
| 31 | fi |