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.
 
 
 
 
 

82 lines
1.8 KiB

  1. #!/bin/bash
  2. app_root_dir="diagrams"
  3. # NOTE: azure icon set is not latest version
  4. providers=(
  5. "onprem"
  6. "aws"
  7. "azure"
  8. "digitalocean"
  9. "gcp"
  10. "ibm"
  11. "firebase"
  12. "k8s"
  13. "alibabacloud"
  14. "oci"
  15. "programming"
  16. "saas"
  17. "elastic"
  18. "generic"
  19. "openstack"
  20. "outscale"
  21. )
  22. if ! [ -x "$(command -v round)" ]; then
  23. echo 'round is not installed'
  24. exit 1
  25. fi
  26. if ! [ -x "$(command -v inkscape)" ]; then
  27. echo 'inkscape is not installed'
  28. exit 1
  29. fi
  30. if ! [ -x "$(command -v convert)" ]; then
  31. echo 'image magick is not installed'
  32. exit 1
  33. fi
  34. if ! [ -x "$(command -v black)" ]; then
  35. echo 'black is not installed'
  36. exit 1
  37. fi
  38. # preprocess the resources
  39. for pvd in "${providers[@]}"; do
  40. # convert the svg to png for azure provider
  41. if [ "$pvd" = "onprem" ] || [ "$pvd" = "azure" ]; then
  42. echo "converting the svg to png using inkscape for provider '$pvd'"
  43. python -m scripts.resource svg2png "$pvd"
  44. fi
  45. if [ "$pvd" == "oci" ] || [ "$pvd" = "ibm" ]; then
  46. echo "converting the svg to png using image magick for provider '$pvd'"
  47. python -m scripts.resource svg2png2 "$pvd"
  48. fi
  49. echo "cleaning the resource names for provider '$pvd'"
  50. python -m scripts.resource clean "$pvd"
  51. # round the all png images for aws provider
  52. if [ "$pvd" = "aws" ]; then
  53. echo "rounding the resources for provider '$pvd'"
  54. python -m scripts.resource round "$pvd"
  55. fi
  56. done
  57. # generate the module classes and docs
  58. for pvd in "${providers[@]}"; do
  59. echo "generating the modules & docs for provider '$pvd'"
  60. python -m scripts.generate "$pvd"
  61. done
  62. # Generate doc for custom module
  63. echo "generating the docs for custom"
  64. python -m scripts.generate "custom"
  65. # copy icons across to website
  66. echo "copying icons to website static folder"
  67. cp -r resources website/static/img/
  68. # run black
  69. echo "linting the all the diagram modules"
  70. black "$app_root_dir"/**/*.py