Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

autogen.sh 1.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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" "gcp" "firebase" "k8s" "alibabacloud" "oci" "programming" "saas" "elastic" "generic" "openstack")
  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" ]; 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. # run black
  47. echo "linting the all the diagram modules"
  48. black "$app_root_dir"/**/*.py