Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

83 rindas
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. "gis"
  22. )
  23. if ! [ -x "$(command -v round)" ]; then
  24. echo 'round is not installed'
  25. exit 1
  26. fi
  27. if ! [ -x "$(command -v inkscape)" ]; then
  28. echo 'inkscape is not installed'
  29. exit 1
  30. fi
  31. if ! [ -x "$(command -v convert)" ]; then
  32. echo 'image magick is not installed'
  33. exit 1
  34. fi
  35. if ! [ -x "$(command -v black)" ]; then
  36. echo 'black is not installed'
  37. exit 1
  38. fi
  39. # preprocess the resources
  40. for pvd in "${providers[@]}"; do
  41. # convert the svg to png for azure provider
  42. if [ "$pvd" = "onprem" ] || [ "$pvd" = "azure" ]; then
  43. echo "converting the svg to png using inkscape for provider '$pvd'"
  44. python -m scripts.resource svg2png "$pvd"
  45. fi
  46. if [ "$pvd" == "oci" ] || [ "$pvd" = "ibm" ]; then
  47. echo "converting the svg to png using image magick for provider '$pvd'"
  48. python -m scripts.resource svg2png2 "$pvd"
  49. fi
  50. echo "cleaning the resource names for provider '$pvd'"
  51. python -m scripts.resource clean "$pvd"
  52. # round the all png images for aws provider
  53. if [ "$pvd" = "aws" ]; then
  54. echo "rounding the resources for provider '$pvd'"
  55. python -m scripts.resource round "$pvd"
  56. fi
  57. done
  58. # generate the module classes and docs
  59. for pvd in "${providers[@]}"; do
  60. echo "generating the modules & docs for provider '$pvd'"
  61. python -m scripts.generate "$pvd"
  62. done
  63. # Generate doc for custom module
  64. echo "generating the docs for custom"
  65. python -m scripts.generate "custom"
  66. # copy icons across to website
  67. echo "copying icons to website static folder"
  68. cp -r resources website/static/img/
  69. # run black
  70. echo "linting the all the diagram modules"
  71. black "$app_root_dir"/**/*.py