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 | 34d3fda | 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/ |
Ievgeniia Zadorozhna | 3d20752 | 2024-02-01 01:36:43 +0100 | [diff] [blame^] | 13 | # Copy actual rally-files to the rally pod: |
| 14 | kubectl cp /opt/res-files/k8s/rally-files/ qa-space/rally:/rally/ |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 15 | |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 16 | ### |
| 17 | if [ ! -z $(kubectl exec -n qa-space --stdin rally -- rally env list | grep openstack | cut -d' ' -f2) ]; then |
| 18 | echo "# Openstack env already created" |
| 19 | kubectl exec -n qa-space --stdin rally -- rally env list |
| 20 | else |
| 21 | echo "# Creating openstack env" |
| 22 | kubectl exec -n qa-space --stdin rally -- bash -c "bash /rally/rally-files/init-rally-openstack.sh" |
| 23 | fi |
| 24 | echo " " |
| 25 | ### |
| 26 | if [ ! -z $(kubectl exec -n qa-space --stdin rally -- rally env list | grep kubernetes | cut -d' ' -f2) ]; then |
| 27 | echo "# Kubernetes env already created" |
| 28 | kubectl exec -n qa-space --stdin rally -- rally env list |
| 29 | else |
| 30 | echo "# Creating kubernetes env" |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 31 | kubectl cp $MY_PROJFOLDER/envs/mos-kubeconfig.yaml qa-space/rally:/artifacts/mos-kubeconfig.yaml |
| 32 | kubectl exec -n qa-space --stdin rally -- bash -c "bash /rally/rally-files/init-rally-kube.sh" |
| 33 | fi |