date.chapril.org-framadate/.gitlab-ci.yml
Paul B 64f086c04f
i18n: adds a check on missing translation keys in locale/*.json file
This commit adds a script to check all keys from translation files to
make sure no missing keys / no translation files are incorrect.

Even if missing keys should not happen (because we use a script to add
keys automatically) this script made helped to understand that all
three `ar`, `eo` and `fr_FR` translation files were completly off
compared to the `en.json` file.

I believe we can safely delete `ar`, `eo` and `fr_FR` locales from
Zanata (because those languages are not set in the ALLOWED_LANGUAGES
config array). ⚠️ this needs to be check in the production `config.php`
file ⚠️.

Deleting the `fr_FR` locale file should solve both !358 and #395

closes !358 #395
2019-04-16 14:55:15 +02:00

115 lines
4.1 KiB
YAML

image: framasoft/framadate-ci
stages:
- test
- deploy
- beta
- funky
# Run php-cs-fixer and phpunit on all branches
test:
stage: test
script:
- composer install -o --no-interaction --no-progress --prefer-dist
- php vendor/bin/php-cs-fixer fix --verbose --dry-run
- APP_ENV=test bin/doctrine migrations:migrate --no-interaction -vvv
- vendor/bin/phpunit --bootstrap app/tests/bootstrap.php --debug app/tests
cache:
paths:
- vendor/
check:missing:trads:
stage: test
script:
- ./scripts/check-translations.py
# check-trad:
# stage: test
# allow_failure: true
# script:
# - if [ -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then echo "*** Unable to check if translations need to be pulled, exiting ***"; exit 1; fi
# - export ORIG=$(git diff-files --shortstat)
# - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
# - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make push-locales; fi
# - git status > /dev/null 2>&1
# - export CHANGES=$(git diff-files --shortstat)
# - if [[ $CHANGES != $ORIG ]]; then echo "*** There is changes in locales ***"; echo "*** You need to do `make pull-locales` in your repo ***"; exit 1; fi
# only:
# - develop
# Create artifacts on master
pages:
stage: deploy
script:
- latesttag=$(git describe --tags)
- git checkout ${latesttag}
- composer install -o --no-interaction --no-progress --prefer-dist --no-dev
- composer dump-autoload --optimize --no-dev --classmap-authoritative
- mkdir framadate
- mv `ls -A | grep -v framadate` ./framadate
- find framadate/ -type d -exec chmod 750 {} \;
- find framadate/ -type f -exec chmod 640 {} \;
- rm -rf framadate/.git
- zip -r latest.zip framadate
- mkdir .public
- cp latest.zip .public
- mv .public public
artifacts:
paths:
- public
only:
- tags
except:
- (beta|alpha)
# Deploy on develop
beta:
stage: beta
script:
- git checkout develop
- composer install -o --no-interaction --no-progress --prefer-dist --no-dev
- composer dump-autoload --optimize --no-dev --classmap-authoritative
# - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
# - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make pull-locales; fi
- mkdir .public
- cp -r * .public
- cp -r .git .public
- mv .public public
- mkdir "${HOME}/.ssh"
- chmod 700 "${HOME}/.ssh"
- if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
- eval `ssh-agent -s`
- if [ ! -z ${BETA_KEY+x} ]; then ssh-add <(echo "${BETA_KEY}" | base64 --decode -i); fi
- if [ ! -z ${BETA_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${BETA_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
only:
- develop
# Deploy on funky
funky:
stage: funky
script:
- git checkout funky
- composer install
- mkdir tpl_c
- mkdir .public
- cp -r * .public
- mv .public public
- mkdir "${HOME}/.ssh"
- chmod 700 "${HOME}/.ssh"
- if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
- eval `ssh-agent -s`
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}" | base64 --decode -i); fi
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
only:
- funky
# Push new translations strings to https://trad.framasoft.org
# trads:
# stage: deploy
# image: framasoft/push-trad:latest
# script:
# - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
# - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make push-locales; fi
# only:
# - develop
# - master