You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

51 regels
1.3 KiB

  1. #!/bin/bash
  2. app_root_dir="diagrams"
  3. # NOTE: azure icon set is not latest version
  4. providers=("aws" "azure" "gcp" "k8s" "alibabacloud" "oci")
  5. if ! [ -x "$(command -v round)" ]; then
  6. echo 'round is not installed'
  7. exit 1
  8. fi
  9. if ! [ -x "$(command -v inkscape)" ]; then
  10. echo 'inkscape is not installed'
  11. exit 1
  12. fi
  13. if ! [ -x "$(command -v convert)" ]; then
  14. echo 'image magick is not installed'
  15. exit 1
  16. fi
  17. # preprocess the resources
  18. for pvd in "${providers[@]}"; do
  19. # convert the svg to png for azure provider
  20. if [ "$pvd" = "azure" ]; then
  21. echo "converting the svg to png using inkscape for provider '$pvd'"
  22. python -m scripts.resource svg2png "$pvd"
  23. fi
  24. if [ "$pvd" == "oci" ]; then
  25. echo "converting the svg to png using image magick for provider '$pvd'"
  26. python -m scripts.resource svg2png2 "$pvd"
  27. fi
  28. echo "cleaning the resource names for provider '$pvd'"
  29. python -m scripts.resource clean "$pvd"
  30. # round the all png images for aws provider
  31. if [ "$pvd" = "aws" ]; then
  32. echo "rounding the resources for provider '$pvd'"
  33. python -m scripts.resource round "$pvd"
  34. fi
  35. done
  36. # generate the module classes and docs
  37. for pvd in "${providers[@]}"; do
  38. echo "generating the modules & docs for provider '$pvd'"
  39. python -m scripts.generate "$pvd"
  40. done
  41. # run black
  42. echo "linting the all the diagram modules"
  43. black "$app_root_dir"/**/*.py