Skip to content

Commit

Permalink
Migrate travis-ci and docker to yaml config
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Mar 14, 2019
1 parent 87febb6 commit 3675a67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 6 additions & 9 deletions .travis.yml
Expand Up @@ -72,20 +72,19 @@ install:
before_script:
# enable shell errors
- set -e
- cp etc/volkszaehler.conf.template.php etc/volkszaehler.conf.php
- cp etc/config.dist.yaml etc/config.yaml

- DATABASE=volkszaehler
- USER=root
- PASSWORD=
- if [ "$DB" = "pgsql" ]; then USER=postgres; fi

# create config file
- sed -i "s/'pdo_mysql'/'pdo_$DB'/" etc/volkszaehler.conf.php
- sed -i "s/'vz'/'$USER'/" etc/volkszaehler.conf.php
- sed -i "s/'demo'/'$PASSWORD'/" etc/volkszaehler.conf.php
- sed -i "s/'volkszaehler'/'$DATABASE'/" etc/volkszaehler.conf.php
- if [ "$DB" = "sqlite" ]; then sed -i "s/\?>/\$config['db']['path']\ =\ VZ_DIR.'\/sqlite.db3'\;\n?>/" etc/volkszaehler.conf.php; fi
- cat etc/volkszaehler.conf.php
- sed -i "s/'pdo_mysql'/'pdo_$DB'/" etc/config.yaml
- sed -i "s/'vz'/'$USER'/" etc/config.yaml
- sed -i "s/'demo'/'$PASSWORD'/" etc/config.yaml
- sed -i "s/'volkszaehler'/'$DATABASE'/" etc/config.yaml
- cat etc/config.yaml

# create database
- if [ "$DB" = "mysql" ]; then mysql -e "CREATE DATABASE $DATABASE;" -u $USER; fi
Expand All @@ -104,7 +103,6 @@ before_script:
# push server tests
- |
if [ "$COMPONENT" = "PUSHD" ]; then
sed -i "s/\?>/\$config['push']['enabled']\ =\ true\;\n?>/" etc/volkszaehler.conf.php
php bin/push-server &
fi
Expand All @@ -122,7 +120,6 @@ script:
# run aggregation tests (mysql only)
- |
if [ "$DB" = "mysql" ]; then
sed -i "s/\?>/\$config['aggregation']\ =\ true;\n?>/" etc/volkszaehler.conf.php
php bin/aggregate run -m delta -l hour
vendor/bin/phpunit $TRAVIS_TEST_EXCLUDES
fi
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile
Expand Up @@ -18,10 +18,6 @@ EXPOSE 8082
EXPOSE 5582

COPY --from=builder /vz /vz
COPY etc/volkszaehler.conf.template.php /vz/etc/volkszaehler.conf.php

# modify volkszaehler.conf
RUN sed -i 's/?>//' /vz/etc/volkszaehler.conf.php

# modify options.js
RUN sed -i "s/url: 'middleware.php'/url: '',/" /vz/htdocs/js/options.js
Expand Down

0 comments on commit 3675a67

Please sign in to comment.