3 - PHP_MAJOR_VERSION: 7.4
9 # This forces CI executions at the "opensocial" labeled location (because of much more power...)
15 image: friendicaci/transifex
17 - export DBSTRUCTURE_VERSION="$(sed -rn "s/.*'DB_UPDATE_VERSION', ([0-9]+).*/\1/p" static/dbstructure.config.php)"
18 - export DATABASE_VERSION="$(sed -rn 's/.*DB_UPDATE_VERSION ([0-9]+).*/\1/p' database.sql)"
19 - echo "Database $DATABASE_VERSION - DB-Structure $DBSTRUCTURE_VERSION"
20 - if [ "$DBSTRUCTURE_VERSION" != "$DATABASE_VERSION" ]; then
21 echo "Database version mismatch.";
25 image: meltwater/drone-cache:dev
29 cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
30 archive_format: "gzip"
34 - /tmp/drone-cache:/tmp/cache
36 image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
38 - export COMPOSER_HOME=.composer
39 - ./bin/composer.phar validate
40 - ./bin/composer.phar install --prefer-dist
42 - /etc/hosts:/etc/hosts
44 image: meltwater/drone-cache:dev
48 cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
49 archive_format: "gzip"
53 - /tmp/drone-cache:/tmp/cache
54 recreate_database.sql:
55 image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
59 MYSQL_DATABASE: "test"
60 MYSQL_PASSWORD: "test"
63 MEMCACHED_HOST: "memcached"
64 MEMCACHE_HOST: "memcached"
65 XDEBUG_MODE: "coverage"
68 - cp config/local-sample.config.php config/local.config.php
69 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
70 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
71 - php ./bin/console.php dbstructure dumpsql > database.sql
75 - git update-index --refresh
76 - git diff-index --quiet HEAD --
77 - if [[ $? -ne 0 ]]; then
78 echo "database.sql mismatch.";
86 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
87 MYSQL_DATABASE: "test"
88 MYSQL_PASSWORD: "test"