25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

autogen.sh 1.7 KiB

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