006e5c8c10
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
image: php
|
|
stages:
|
|
- deploy
|
|
- funky
|
|
pages:
|
|
stage: deploy
|
|
before_script:
|
|
- apt-get update -yqq
|
|
- apt-get install zip unzip git -yqq
|
|
- curl --silent --show-error https://getcomposer.org/installer | php
|
|
script:
|
|
- latesttag=$(git describe --tags)
|
|
- git checkout ${latesttag}
|
|
- php composer.phar install -o --no-interaction --no-progress --prefer-dist
|
|
- php vendor/bin/php-cs-fixer fix --verbose --dry-run
|
|
- vendor/bin/phpunit --bootstrap app/tests/bootstrap.php --debug app/tests
|
|
- mkdir tpl_c
|
|
- zip -r latest.zip .
|
|
- mkdir .public
|
|
- cp latest.zip .public
|
|
- mv .public public
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- master
|
|
|
|
funky:
|
|
stage: funky
|
|
before_script:
|
|
- apt-get update -y -qq
|
|
- DEBIAN_FRONTEND=noninteractive apt-get install -y -qq zip unzip git
|
|
- curl --silent --show-error https://getcomposer.org/installer | php
|
|
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 errors/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
|
|
only:
|
|
- funky
|