|
@@ -1,5 +1,5 @@
|
|
|
# Write CI cache once for faster runs
|
|
|
-'write runner cache: ruby':
|
|
|
+'write cache: ruby':
|
|
|
stage: pre
|
|
|
cache: !reference [.cache, read_write_ruby]
|
|
|
before_script:
|
|
@@ -8,14 +8,12 @@
|
|
|
- !reference [.scripts, bundle_install]
|
|
|
after_script: []
|
|
|
|
|
|
-'write runner cache: nodejs':
|
|
|
+'write cache: nodejs':
|
|
|
stage: pre
|
|
|
cache: !reference [.cache, read_write_nodejs]
|
|
|
before_script: []
|
|
|
script:
|
|
|
- !reference [.scripts, pnpm_install_all]
|
|
|
- - pnpm cypress:install
|
|
|
- - pnpm --dir ./.eslint-plugin-zammad install
|
|
|
after_script: []
|
|
|
|
|
|
'push to github':
|
|
@@ -56,3 +54,40 @@
|
|
|
script:
|
|
|
- script/build/deploy_archives.sh
|
|
|
after_script: []
|
|
|
+
|
|
|
+# This job will create commits in pipelines pushed from Weblate.
|
|
|
+# It re-generates the catalog, and any additional files such as view templates and chat assets.
|
|
|
+'push translations update commit':
|
|
|
+ stage: pre
|
|
|
+ needs: ['write cache: ruby', 'write cache: nodejs']
|
|
|
+ rules:
|
|
|
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE =~ /Translations update from translations[.]zammad[.]org/
|
|
|
+ when: always
|
|
|
+ - when: never
|
|
|
+ cache:
|
|
|
+ - !reference [.cache, read_only_ruby]
|
|
|
+ - !reference [.cache, read_only_nodejs]
|
|
|
+ services:
|
|
|
+ - !reference [.services, postgresql]
|
|
|
+ before_script:
|
|
|
+ - !reference [.scripts, source_rvm]
|
|
|
+ - !reference [.scripts, bundle_install]
|
|
|
+ - !reference [.scripts, configure_environment]
|
|
|
+ - !reference [.scripts, zammad_db_init]
|
|
|
+ - !reference [.scripts, pnpm_install_chat]
|
|
|
+ variables:
|
|
|
+ ZAMMAD_SAFE_MODE: 1
|
|
|
+ script:
|
|
|
+ - bundle exec rails generate zammad:translation_catalog --full
|
|
|
+ - (cd public/assets/chat && pnpm exec gulp build)
|
|
|
+ - git status
|
|
|
+ - git config user.email "noreply@weblate.org"
|
|
|
+ - git config user.name "Weblate"
|
|
|
+ # TODO drop usage of dedicated access token when CI_JOB_TOKEN support for commit pushing was added to weblate
|
|
|
+ # https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html#git-push-to-your-project-repository
|
|
|
+ - git remote add gitlab_origin https://oauth2:${WEBLATE_ACCESS_TOKEN}@${CI_SERVER_FQDN}/${CI_PROJECT_PATH}.git
|
|
|
+ - git add .
|
|
|
+ - git status --porcelain | grep "^[MA]" || exit 0 # check if files were added/changed
|
|
|
+ - 'git commit -m "Maintenance: Update translated files and catalog"'
|
|
|
+ - git show --stat
|
|
|
+ - git push gitlab_origin HEAD:$CI_COMMIT_REF_NAME
|