blob: 887646e2f07e42731dd14d55910a9a98d0e1658d [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/
Ievgeniia Zadorozhna11dde202024-02-01 01:36:43 +010013# Copy actual rally-files to the rally pod:
14kubectl cp /opt/res-files/k8s/rally-files/ qa-space/rally:/rally/
Alex2c8b8802022-10-20 14:07:15 -050015
Alexa0053b92022-10-14 16:38:28 -050016###
17if [ ! -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
20else
21 echo "# Creating openstack env"
22 kubectl exec -n qa-space --stdin rally -- bash -c "bash /rally/rally-files/init-rally-openstack.sh"
23fi
24echo " "
25###
26if [ ! -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
29else
30 echo "# Creating kubernetes env"
Alexa0053b92022-10-14 16:38:28 -050031 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"
33fi