3 - PHP_MAJOR_VERSION: 7.4
11 image: friendicaci/transifex
13 - export DBSTRUCTURE_VERSION="$(sed -rn "s/.*'DB_UPDATE_VERSION', ([0-9]+).*/\1/p" static/dbstructure.config.php)"
14 - export DATABASE_VERSION="$(sed -rn 's/.*DB_UPDATE_VERSION ([0-9]+).*/\1/p' database.sql)"
15 - echo "Database $DATABASE_VERSION - DB-Structure $DBSTRUCTURE_VERSION"
16 - if [ "$DBSTRUCTURE_VERSION" != "$DATABASE_VERSION" ]; then
17 echo "Database version mismatch.";
21 image: meltwater/drone-cache:dev
25 cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
26 archive_format: "gzip"
30 - /tmp/drone-cache:/tmp/cache
32 image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
34 - export COMPOSER_HOME=.composer
35 - ./bin/composer.phar validate
36 - ./bin/composer.phar install --prefer-dist
38 - /etc/hosts:/etc/hosts
40 image: meltwater/drone-cache:dev
44 cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
45 archive_format: "gzip"
49 - /tmp/drone-cache:/tmp/cache
50 recreate_database.sql:
51 image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
55 MYSQL_DATABASE: "test"
56 MYSQL_PASSWORD: "test"
59 MEMCACHED_HOST: "memcached"
60 MEMCACHE_HOST: "memcached"
61 XDEBUG_MODE: "coverage"
64 - cp config/local-sample.config.php config/local.config.php
65 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
66 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
67 - php ./bin/console.php dbstructure dumpsql > database.sql
71 - git update-index --refresh
72 - git diff-index --quiet HEAD --
73 - if [[ $? -ne 0 ]]; then
74 echo "database.sql mismatch.";
82 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
83 MYSQL_DATABASE: "test"
84 MYSQL_PASSWORD: "test"