Verified Commit 74917ec7 authored by Elias Häußler's avatar Elias Häußler 🐛 Committed by Elias Häußler

[WIP][TASK] Add Gitlab CI configuration

parent 26cb6c75
Pipeline #38 canceled with stages
in 1 minute and 31 seconds
image: php:7.1
cache:
paths:
- docs/cache/
- vendor/
stages:
- test
- build
- deploy
build:
stage: build
image: composer:1
script:
- composer install
- sh sbin/generate_documentation.sh
test:
stage: test
before_script:
- curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/latest/download/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer
- chmod +x /usr/local/bin/php-cs-fixer
script:
- php-cs-fixer fix --config=.php_cs.dist --dry-run --diff
deploy:
stage: deploy
image: composer:1
variables:
REMOTE_HOST: "${REMOTE_USER}@${REMOTE_HOSTNAME}"
before_script:
# Remote target configuration
- cp remote.env.dist remote.env
- sed -i "s|TARGET_HOST=.*|TARGET_HOST=$REMOTE_HOST|g" remote.env
- sed -i "s|TARGET_PATH=.*|TARGET_PATH=$REMOTE_PATH|g" remote.env
- sed -i "s|TARGET_PORT=.*|TARGET_PORT=$REMOTE_PORT|g" remote.env
- cat remote.env
# Environment configuration
- apk add rsync --update
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | ssh-add -
- ssh-keyscan -p ${REMOTE_PORT} ${REMOTE_HOSTNAME} >> ~/.ssh/known_hosts
script:
- find . -type d -exec chmod 755 {} \;
- sh sbin/deploy.sh
# only:
# - tags
......@@ -62,7 +62,7 @@ output " Done." ${SUCCESS}
# Set new release on remote
ssh ${TARGET_HOST} -p ${TARGET_PORT} -T << __EOF
$(typeset -f output)
typeset -f output
set -e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment