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
168 image: plugins/codecov
171 - friendica/friendica
174 from_secret: codecov-token
177 - name: Check database.sql
180 - git update-index --refresh
181 - git diff-index --quiet HEAD --
182 - if [[ $? -ne 0 ]]; then
183 echo "database.sql mismatch.";
189 image: mariadb:latest
191 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
192 MYSQL_DATABASE: "test"
193 MYSQL_PASSWORD: "test"
201 path: /tmp/drone-cache
211 - name: Restore cache
212 image: meltwater/drone-cache:dev
214 backend: "filesystem"
216 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
217 archive_format: "gzip"
223 - name: Composer install
224 image: friendicaci/php7.3:php7.3.28
226 - export COMPOSER_HOME=.composer
227 - ./bin/composer.phar validate
228 - ./bin/composer.phar install --prefer-dist
229 - name: Rebuild cache
230 image: meltwater/drone-cache:dev
232 backend: "filesystem"
234 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
235 archive_format: "gzip"
241 - name: Test Friendica
242 image: friendicaci/php7.3:php7.3.28
244 MYSQL_HOST: "mariadb"
246 MYSQL_DATABASE: "test"
247 MYSQL_PASSWORD: "test"
250 MEMCACHED_HOST: "memcached"
251 MEMCACHE_HOST: "memcached"
253 - cp config/local-sample.config.php config/local.config.php
254 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
255 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
256 - phpunit --configuration tests/phpunit.xml
260 image: mariadb:latest
262 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
263 MYSQL_DATABASE: "test"
264 MYSQL_PASSWORD: "test"
278 path: /tmp/drone-cache
288 - name: Restore cache
289 image: meltwater/drone-cache:dev
291 backend: "filesystem"
293 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
294 archive_format: "gzip"
300 - name: Composer install
301 image: friendicaci/php7.4:php7.4.18
303 - export COMPOSER_HOME=.composer
304 - ./bin/composer.phar validate
305 - ./bin/composer.phar install --prefer-dist
306 - name: Rebuild cache
307 image: meltwater/drone-cache:dev
309 backend: "filesystem"
311 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
312 archive_format: "gzip"
318 - name: Test Friendica
319 image: friendicaci/php7.4:php7.4.18
321 MYSQL_HOST: "mariadb"
323 MYSQL_DATABASE: "test"
324 MYSQL_PASSWORD: "test"
327 MEMCACHED_HOST: "memcached"
328 MEMCACHE_HOST: "memcached"
329 XDEBUG_MODE: "coverage"
332 - cp config/local-sample.config.php config/local.config.php
333 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
334 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
335 - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
337 image: plugins/codecov
340 - friendica/friendica
343 from_secret: codecov-token
349 image: mariadb:latest
351 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
352 MYSQL_DATABASE: "test"
353 MYSQL_PASSWORD: "test"
367 path: /tmp/drone-cache
377 - name: Restore cache
378 image: meltwater/drone-cache:dev
380 backend: "filesystem"
382 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
383 archive_format: "gzip"
389 - name: Composer install
390 image: friendicaci/php8.0:php8.0.5
392 - export COMPOSER_HOME=.composer
393 - ./bin/composer.phar validate
394 - ./bin/composer.phar install --prefer-dist
395 - name: Rebuild cache
396 image: meltwater/drone-cache:dev
398 backend: "filesystem"
400 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
401 archive_format: "gzip"
407 - name: Test Friendica
408 image: friendicaci/php8.0:php8.0.5
410 MYSQL_HOST: "mariadb"
412 MYSQL_DATABASE: "test"
413 MYSQL_PASSWORD: "test"
416 MEMCACHED_HOST: "memcached"
417 MEMCACHE_HOST: "memcached"
419 - cp config/local-sample.config.php config/local.config.php
420 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
421 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
422 - phpunit --configuration tests/phpunit.xml
426 image: mariadb:latest
428 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
429 MYSQL_DATABASE: "test"
430 MYSQL_PASSWORD: "test"
444 path: /tmp/drone-cache
448 name: continuous-deployment
457 - friendica/friendica
465 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
468 - name: Restore cache
469 image: meltwater/drone-cache:dev
471 backend: "filesystem"
473 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
474 archive_format: "gzip"
481 - name: Composer install
482 image: friendicaci/php7.4:php7.4.18
484 - export COMPOSER_HOME=.composer
486 - composer install --no-dev --optimize-autoloader
487 - name: Create artifacts
491 - apt-get install bzip2
493 - export VERSION="$(cat VERSION)"
495 - export RELEASE="friendica-full-$VERSION"
496 - export ARTIFACT="$RELEASE.tar.gz"
498 --transform "s,^,$RELEASE/,"
499 -X mods/release-list-exclude.txt
500 -T mods/release-list-include.txt
501 -cvzf ./build/$ARTIFACT
502 - # calculate SHA256 checksum
504 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
507 - # output the sha256 sum for checking
508 - cat "$ARTIFACT.sum256"
509 - sha256sum "$ARTIFACT"
510 - name: Sign artifacts
511 image: plugins/gpgsign
516 from_secret: gpg_password
522 - name: Upload artifacts
526 from_secret: sftp_host
528 from_secret: sftp_user
535 - apk add lftp openssh openssl
537 - chmod 400 drone.key
538 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
541 set net:max-retries 2;
542 set net:reconnect-interval-base 5;
543 set sftp:auto-confirm true;
544 set sftp:connect-program 'ssh -q -a -x -i drone.key';
545 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
554 path: /tmp/drone-cache
558 name: release-deployment
567 - friendica/friendica
574 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
577 - name: Restore cache
578 image: meltwater/drone-cache:dev
580 backend: "filesystem"
582 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
583 archive_format: "gzip"
590 - name: Composer install
591 image: friendicaci/php7.4:php7.4.18
593 - export COMPOSER_HOME=.composer
595 - composer install --no-dev --optimize-autoloader
596 - name: Create artifacts
600 - apt-get install bzip2
602 - export VERSION="$(cat VERSION)"
604 - export RELEASE="friendica-full-$VERSION"
605 - export ARTIFACT="$RELEASE.tar.gz"
607 --transform "s,^,$RELEASE/,"
608 -X mods/release-list-exclude.txt
609 -T mods/release-list-include.txt
610 -cvzf ./build/$ARTIFACT
611 - # calculate SHA256 checksum
613 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
616 - # output the sha256 sum for checking
617 - cat "$ARTIFACT.sum256"
618 - sha256sum "$ARTIFACT"
619 - name: Sign artifacts
620 image: plugins/gpgsign
625 from_secret: gpg_password
631 - name: Upload artifacts
635 from_secret: sftp_host
637 from_secret: sftp_user
644 - apk add lftp openssh openssl
646 - chmod 400 drone.key
647 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
650 set net:max-retries 2;
651 set net:reconnect-interval-base 5;
652 set sftp:auto-confirm true;
653 set sftp:connect-program 'ssh -q -a -x -i drone.key';
654 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
663 path: /tmp/drone-cache