Fixups and cleanup for GitLab CI

This commit is contained in:
Igor Scheller 2018-09-03 21:56:49 +02:00 committed by msquare
parent 2c1c00e9c9
commit 9f1ee0c6c6
4 changed files with 9 additions and 18 deletions

View File

@ -51,10 +51,6 @@ test:
when: always when: always
paths: paths:
- ./coverage/ - ./coverage/
- ./unittests.xml
when: always
reports:
junit: ./unittests.xml
coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/' coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/'
before_script: before_script:
- apk add $PHPIZE_DEPS && pecl install xdebug && docker-php-ext-enable xdebug - apk add $PHPIZE_DEPS && pecl install xdebug && docker-php-ext-enable xdebug
@ -63,15 +59,10 @@ test:
- HOMEDIR=$(pwd) - HOMEDIR=$(pwd)
- cd "${DOCROOT}" - cd "${DOCROOT}"
- composer --no-ansi install --dev - composer --no-ansi install --dev
- chmod +x ./bin/migrate
- ./bin/migrate - ./bin/migrate
script: script:
- set +e - vendor/bin/phpunit -v --colors=never --coverage-text --coverage-html "${HOMEDIR}/coverage/"
- vendor/bin/phpunit -v --colors=never --coverage-text --coverage-html "${HOMEDIR}/coverage/" --log-junit "${HOMEDIR}/unittests.xml" - ./bin/migrate down
- status=$?
- set -e
- sed -i "s~${DOCROOT}~${HOMEDIR}/~g" "${HOMEDIR}/unittests.xml"
- exit $status
release-image: release-image:
<<: *docker_definition <<: *docker_definition
@ -102,7 +93,6 @@ release-image.nginx:
.deploy_template_script: .deploy_template_script:
# Configure SSH # Configure SSH
- &deploy_template_script |- - &deploy_template_script |-
apt update && apt install -yqq rsync openssh-client
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" | sed -e 's/\r//g' > ~/.ssh/id_ed25519 echo "$SSH_PRIVATE_KEY" | sed -e 's/\r//g' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519

View File

@ -112,7 +112,7 @@ For usage see `./bin/deploy.sh -h`
##### bin/migrate ##### bin/migrate
The `bin/migrate` script can be used to import and update the database of the engelsystem. The `bin/migrate` script can be used to import and update the database of the engelsystem.
For more information on how to use it call `bin/migrate help` For more information on how to use it call `./bin/migrate help`
### Codestyle ### Codestyle
Please ensure that your pull requests follow [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/). Please ensure that your pull requests follow [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/).

View File

@ -58,13 +58,13 @@ ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "${remote_hos
set -e set -e
if [[ -f \"${remote_path}/current/config/config.php\" ]]; then if [[ -f \"${remote_path}/current/config/config.php\" ]]; then
echo \"Config backup\" echo \"Configuring\"
cp \"${remote_path}/current/config/config.php\" \"${deploy_id}-config.php\" cp \"${remote_path}/current/config/config.php\" \"${remote_path}/${deploy_id}/config/config.php\"
echo \"Restoring config\"
cp \"${deploy_id}-config.php\" \"${remote_path}/${deploy_id}/config/config.php\"
fi fi
echo \"Changing symlink\" echo \"Changing symlink\"
ln -nsf \"${remote_path}/${deploy_id}\" \"${remote_path}/current\" ln -nsf \"${remote_path}/${deploy_id}\" \"${remote_path}/current\"
echo \"Migrating\"
php \"${remote_path}/current/bin/migrate\"
" "

View File

@ -13,6 +13,7 @@ RUN yarn build
# Intermediate container for less layers # Intermediate container for less layers
FROM alpine as data FROM alpine as data
COPY bin/ /app/bin
COPY config/ /app/config COPY config/ /app/config
COPY db/ /app/db COPY db/ /app/db
COPY includes/ /app/includes COPY includes/ /app/includes