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.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. app_root_dir="diagrams"
  3. # NOTE: azure icon set is not latest version
  4. providers=("onprem" "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" = "onprem" ] || [ "$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