3 name: Check messages.po
6 - name: Run default Xgettext
7 image: friendicaci/transifex
9 - ./bin/run_xgettext.sh
12 image: friendicaci/transifex
18 name: Integrity checks
21 - name: Check database version
24 - export DBSTRUCTURE_VERSION="$(sed -rn "s/.*'DB_UPDATE_VERSION', ([0-9]+).*/\1/p" static/dbstructure.config.php)"
25 - export DATABASE_VERSION="$(sed -rn 's/.*DB_UPDATE_VERSION ([0-9]+).*/\1/p' database.sql)"
26 - echo "Database $DATABASE_VERSION - DB-Structure $DBSTRUCTURE_VERSION"
27 - if [[ "$DBSTRUCTURE_VERSION" != "$DATABASE_VERSION" ]]; then
28 echo "Database version mismatch.";
40 - ./bin/composer.phar run lint
50 - ./bin/composer.phar run lint
60 - ./bin/composer.phar run lint
72 image: meltwater/drone-cache:dev
76 cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}'
77 archive_format: "gzip"
83 - name: Install dependencies
86 - export COMPOSER_HOME=.composer
87 - ./bin/composer.phar run cs:install
89 image: meltwater/drone-cache:dev
93 cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}'
94 archive_format: "gzip"
100 - name: Run coding standards check
101 image: friendicaci/php-cs
103 - export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2)"
109 path: /tmp/drone-cache
113 name: php7.4-database-check
119 - name: Restore cache
120 image: meltwater/drone-cache:dev
122 backend: "filesystem"
124 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
125 archive_format: "gzip"
131 - name: Composer install
132 image: friendicaci/php7.4:php7.4.18
134 - export COMPOSER_HOME=.composer
135 - ./bin/composer.phar validate
136 - ./bin/composer.phar install --prefer-dist
137 - name: Rebuild cache
138 image: meltwater/drone-cache:dev
140 backend: "filesystem"
142 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
143 archive_format: "gzip"
149 - name: Recreate database.sql
150 image: friendicaci/php7.4:php7.4.18
152 MYSQL_HOST: "mariadb"
154 MYSQL_DATABASE: "test"
155 MYSQL_PASSWORD: "test"
158 MEMCACHED_HOST: "memcached"
159 MEMCACHE_HOST: "memcached"
160 XDEBUG_MODE: "coverage"
163 - cp config/local-sample.config.php config/local.config.php
164 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
165 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
166 - php ./bin/console.php dbstructure dumpsql > database.sql
167 - name: Check database.sql
170 - git update-index --refresh
171 - git diff-index --quiet HEAD --
172 - if [[ $? -ne 0 ]]; then
173 echo "database.sql mismatch.";
179 image: mariadb:latest
181 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
182 MYSQL_DATABASE: "test"
183 MYSQL_PASSWORD: "test"
191 path: /tmp/drone-cache
201 - name: Restore cache
202 image: meltwater/drone-cache:dev
204 backend: "filesystem"
206 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
207 archive_format: "gzip"
213 - name: Composer install
214 image: friendicaci/php7.3:php7.3.28
216 - export COMPOSER_HOME=.composer
217 - ./bin/composer.phar validate
218 - ./bin/composer.phar install --prefer-dist
219 - name: Rebuild cache
220 image: meltwater/drone-cache:dev
222 backend: "filesystem"
224 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
225 archive_format: "gzip"
231 - name: Test Friendica
232 image: friendicaci/php7.3:php7.3.28
234 MYSQL_HOST: "mariadb"
236 MYSQL_DATABASE: "test"
237 MYSQL_PASSWORD: "test"
240 MEMCACHED_HOST: "memcached"
241 MEMCACHE_HOST: "memcached"
243 - cp config/local-sample.config.php config/local.config.php
244 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
245 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
246 - phpunit --configuration tests/phpunit.xml
250 image: mariadb:latest
252 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
253 MYSQL_DATABASE: "test"
254 MYSQL_PASSWORD: "test"
268 path: /tmp/drone-cache
278 - name: Restore cache
279 image: meltwater/drone-cache:dev
281 backend: "filesystem"
283 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
284 archive_format: "gzip"
290 - name: Composer install
291 image: friendicaci/php7.4:php7.4.18
293 - export COMPOSER_HOME=.composer
294 - ./bin/composer.phar validate
295 - ./bin/composer.phar install --prefer-dist
296 - name: Rebuild cache
297 image: meltwater/drone-cache:dev
299 backend: "filesystem"
301 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
302 archive_format: "gzip"
308 - name: Test Friendica
309 image: friendicaci/php7.4:php7.4.18
311 MYSQL_HOST: "mariadb"
313 MYSQL_DATABASE: "test"
314 MYSQL_PASSWORD: "test"
317 MEMCACHED_HOST: "memcached"
318 MEMCACHE_HOST: "memcached"
319 XDEBUG_MODE: "coverage"
322 - cp config/local-sample.config.php config/local.config.php
323 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
324 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
325 - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
327 image: plugins/codecov
330 - friendica/friendica
333 from_secret: codecov-token
339 image: mariadb:latest
341 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
342 MYSQL_DATABASE: "test"
343 MYSQL_PASSWORD: "test"
357 path: /tmp/drone-cache
367 - name: Restore cache
368 image: meltwater/drone-cache:dev
370 backend: "filesystem"
372 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
373 archive_format: "gzip"
379 - name: Composer install
380 image: friendicaci/php8.0:php8.0.5
382 - export COMPOSER_HOME=.composer
383 - ./bin/composer.phar validate
384 - ./bin/composer.phar install --prefer-dist
385 - name: Rebuild cache
386 image: meltwater/drone-cache:dev
388 backend: "filesystem"
390 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
391 archive_format: "gzip"
397 - name: Test Friendica
398 image: friendicaci/php8.0:php8.0.5
400 MYSQL_HOST: "mariadb"
402 MYSQL_DATABASE: "test"
403 MYSQL_PASSWORD: "test"
406 MEMCACHED_HOST: "memcached"
407 MEMCACHE_HOST: "memcached"
409 - cp config/local-sample.config.php config/local.config.php
410 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
411 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
412 - phpunit --configuration tests/phpunit.xml
416 image: mariadb:latest
418 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
419 MYSQL_DATABASE: "test"
420 MYSQL_PASSWORD: "test"
434 path: /tmp/drone-cache
438 name: continuous-deployment
447 - friendica/friendica
455 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
458 - name: Restore cache
459 image: meltwater/drone-cache:dev
461 backend: "filesystem"
463 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
464 archive_format: "gzip"
471 - name: Composer install
472 image: friendicaci/php7.4:php7.4.18
474 - export COMPOSER_HOME=.composer
476 - composer install --no-dev --optimize-autoloader
477 - name: Create artifacts
481 - apt-get install bzip2
483 - export VERSION="$(cat VERSION)"
485 - export RELEASE="friendica-full-$VERSION"
486 - export ARTIFACT="$RELEASE.tar.gz"
488 --transform "s,^,$RELEASE/,"
489 -X mods/release-list-exclude.txt
490 -T mods/release-list-include.txt
491 -cvzf ./build/$ARTIFACT
492 - # calculate SHA256 checksum
494 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
497 - # output the sha256 sum for checking
498 - cat "$ARTIFACT.sum256"
499 - sha256sum "$ARTIFACT"
500 - name: Sign artifacts
501 image: plugins/gpgsign
506 from_secret: gpg_password
512 - name: Upload artifacts
516 from_secret: sftp_host
518 from_secret: sftp_user
525 - apk add lftp openssh openssl
527 - chmod 400 drone.key
528 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
531 set net:max-retries 2;
532 set net:reconnect-interval-base 5;
533 set sftp:auto-confirm true;
534 set sftp:connect-program 'ssh -q -a -x -i drone.key';
535 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
544 path: /tmp/drone-cache
548 name: release-deployment
557 - friendica/friendica
564 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
567 - name: Restore cache
568 image: meltwater/drone-cache:dev
570 backend: "filesystem"
572 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
573 archive_format: "gzip"
580 - name: Composer install
581 image: friendicaci/php7.4:php7.4.18
583 - export COMPOSER_HOME=.composer
585 - composer install --no-dev --optimize-autoloader
586 - name: Create artifacts
590 - apt-get install bzip2
592 - export VERSION="$(cat VERSION)"
594 - export RELEASE="friendica-full-$VERSION"
595 - export ARTIFACT="$RELEASE.tar.gz"
597 --transform "s,^,$RELEASE/,"
598 -X mods/release-list-exclude.txt
599 -T mods/release-list-include.txt
600 -cvzf ./build/$ARTIFACT
601 - # calculate SHA256 checksum
603 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
606 - # output the sha256 sum for checking
607 - cat "$ARTIFACT.sum256"
608 - sha256sum "$ARTIFACT"
609 - name: Sign artifacts
610 image: plugins/gpgsign
615 from_secret: gpg_password
621 - name: Upload artifacts
625 from_secret: sftp_host
627 from_secret: sftp_user
634 - apk add lftp openssh openssl
636 - chmod 400 drone.key
637 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
640 set net:max-retries 2;
641 set net:reconnect-interval-base 5;
642 set sftp:auto-confirm true;
643 set sftp:connect-program 'ssh -q -a -x -i drone.key';
644 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
653 path: /tmp/drone-cache