modify_config.sh 907 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. echo "check os env"
  5. platform='Linux'
  6. unamestr=$(uname)
  7. if [[ "$unamestr" == 'Linux' ]]; then
  8. platform='Linux'
  9. elif [[ "$unamestr" == 'Darwin' ]]; then
  10. platform='Mac'
  11. fi
  12. echo "platform: $platform"
  13. if [ "$platform" == "Mac" ];
  14. then
  15. sed -i "" "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/${CHAOS_TYPE/-/_}\/'/g" constants.py
  16. sed -i "" "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${POD_NAME}_${CHAOS_TYPE/-/_}.yaml\'/g" constants.py
  17. sed -i "" "s/RELEASE_NAME =.*/RELEASE_NAME = \'${RELEASE_NAME}\'/g" constants.py
  18. else
  19. sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/${CHAOS_TYPE/-/_}\/'/g" constants.py
  20. sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${POD_NAME}_${CHAOS_TYPE/-/_}.yaml\'/g" constants.py
  21. sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${RELEASE_NAME}\'/g" constants.py
  22. fi