Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

65 linhas
3.2 KiB

  1. # SPDX-FileCopyrightText: 2024 Slavi Pantaleev <slavi@devture.com>
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. # Shows help
  5. default:
  6. @just --list --justfile {{ justfile() }}
  7. # Extracts original English strings (translation templates) into the `translation-templates/` directory
  8. extract-translation-templates: _venv
  9. @echo "Extracting translation templates..."
  10. PATH={{ justfile_directory() }}/.venv/bin:$PATH {{ justfile_directory() }}/bin/extract-translation-templates.sh
  11. # Syncs the translation templates (affects `translation-templates/`) and strings (affects `locales/*`) for all published languages (`PUBLISHED_LANGUAGES`)
  12. sync-for-all-published-languages: _venv
  13. #!/bin/sh
  14. cat {{ justfile_directory() }}/PUBLISHED_LANGUAGES | while read language ; do
  15. {{ just_executable() }} sync-for-language $language
  16. done
  17. # Syncs the translation templates (affects `translation-templates/`) and strings for all known languages (`KNOWN_LANGUAGES`)
  18. sync-for-all-known-languages:
  19. #!/bin/sh
  20. find {{ justfile_directory() }}/locales -mindepth 1 -maxdepth 1 -type d | while read path ; do
  21. language=$(basename "$path")
  22. echo "Syncing for language $language.."
  23. {{ just_executable() }} sync-for-language $language
  24. done
  25. # Updates the translation templates (affects `translation-templates/`) and syncs the translation strings for a given language (affects `locales/{{ language }}`)
  26. sync-for-language language: extract-translation-templates (_sync-translation-templates-to-locales-for-language language)
  27. # Updates `locales/{{ language }}` files based on the original template strings from `translation-templates/`
  28. _sync-translation-templates-to-locales-for-language language: _venv
  29. PATH={{ justfile_directory() }}/.venv/bin:$PATH {{ justfile_directory() }}/bin/sync-translation-templates-to-locales.sh {{ language }}
  30. # Builds the translated result for a given language into the `translated/{{ language }}` directory
  31. build-for-language language: _venv
  32. PATH={{ justfile_directory() }}/.venv/bin:$PATH {{ justfile_directory() }}/bin/build-translated-result.sh {{ language }}
  33. # Builds the translated result for all published languages into the `translated/` directory
  34. build-for-all-published-languages:
  35. #!/bin/sh
  36. cat {{ justfile_directory() }}/PUBLISHED_LANGUAGES | while read language ; do
  37. {{ just_executable() }} build-for-language $language
  38. done
  39. # Builds the translated result for all known languages into the `translated/` directory
  40. build-for-all-known-languages:
  41. #!/bin/sh
  42. find {{ justfile_directory() }}/locales -mindepth 1 -maxdepth 1 -type d | while read path ; do
  43. language=$(basename "$path")
  44. echo "Building for language $language.."
  45. {{ just_executable() }} build-for-language $language
  46. done
  47. # Creates the virtual environment and installs the required Python packages
  48. _venv:
  49. #!/bin/sh
  50. if [ ! -f {{ justfile_directory() }}/.venv/bin/sphinx-build ]; then
  51. echo "No sphinx-build found, creating virtual environment and installing requirements..."
  52. uv venv {{ justfile_directory() }}/.venv
  53. VIRTUAL_ENV={{ justfile_directory() }}/.venv uv pip install -r {{ justfile_directory() }}/requirements.txt
  54. fi