date.chapril.org-framadate/.gitlab-ci.yml

69 lines
2.0 KiB
YAML
Raw Normal View History

image: framasoft/framadate-ci
stages:
- test
- deploy
- funky
# Run php-cs-fixer and phpunit on all branches
test:
stage: test
script:
- php composer.phar install -o --no-interaction --no-progress --prefer-dist
- mkdir tpl_c
- php vendor/bin/php-cs-fixer fix --verbose --dry-run
- vendor/bin/phpunit --bootstrap app/tests/bootstrap.php --debug app/tests
cache:
paths:
- vendor/
# Create artifacts on master
pages:
stage: deploy
script:
- latesttag=$(git describe --tags)
- git checkout ${latesttag}
- php composer.phar install -o --no-interaction --no-progress --prefer-dist --no-dev
- php composer.phar dump-autoload --optimize --no-dev --classmap-authoritative
- rm -rf composer.phar
- mkdir tpl_c
- mkdir framadate
- mv `ls -A | grep -v framadate` ./framadate
- zip -r latest.zip framadate
- mkdir .public
- cp latest.zip .public
- mv .public public
artifacts:
paths:
- public
only:
- master
# Deploy on funky
funky:
stage: funky
script:
- git checkout funky
- php composer.phar 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