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: Test Friendica
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.";
195 - name: Restore cache
196 image: meltwater/drone-cache:dev
198 backend: "filesystem"
200 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
201 archive_format: "gzip"
207 - name: Composer install
208 image: friendicaci/php7.3:php7.3.28
210 - export COMPOSER_HOME=.composer
211 - ./bin/composer.phar validate
212 - ./bin/composer.phar install --prefer-dist
213 - name: Rebuild cache
214 image: meltwater/drone-cache:dev
216 backend: "filesystem"
218 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
219 archive_format: "gzip"
225 - name: Test Friendica
226 image: friendicaci/php7.3:php7.3.28
228 MYSQL_HOST: "mariadb"
230 MYSQL_DATABASE: "test"
231 MYSQL_PASSWORD: "test"
234 MEMCACHED_HOST: "memcached"
235 MEMCACHE_HOST: "memcached"
237 - cp config/local-sample.config.php config/local.config.php
238 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
239 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
240 - phpunit --configuration tests/phpunit.xml
244 image: mariadb:latest
246 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
247 MYSQL_DATABASE: "test"
248 MYSQL_PASSWORD: "test"
262 path: /tmp/drone-cache
272 - name: Restore cache
273 image: meltwater/drone-cache:dev
275 backend: "filesystem"
277 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
278 archive_format: "gzip"
284 - name: Composer install
285 image: friendicaci/php7.4:php7.4.18
287 - export COMPOSER_HOME=.composer
288 - ./bin/composer.phar validate
289 - ./bin/composer.phar install --prefer-dist
290 - name: Rebuild cache
291 image: meltwater/drone-cache:dev
293 backend: "filesystem"
295 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
296 archive_format: "gzip"
302 - name: Test Friendica
303 image: friendicaci/php7.4:php7.4.18
305 MYSQL_HOST: "mariadb"
307 MYSQL_DATABASE: "test"
308 MYSQL_PASSWORD: "test"
311 MEMCACHED_HOST: "memcached"
312 MEMCACHE_HOST: "memcached"
313 XDEBUG_MODE: "coverage"
316 - cp config/local-sample.config.php config/local.config.php
317 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
318 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
319 - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
321 image: plugins/codecov
324 - friendica/friendica
327 from_secret: codecov-token
333 image: mariadb:latest
335 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
336 MYSQL_DATABASE: "test"
337 MYSQL_PASSWORD: "test"
351 path: /tmp/drone-cache
361 - name: Restore cache
362 image: meltwater/drone-cache:dev
364 backend: "filesystem"
366 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
367 archive_format: "gzip"
373 - name: Composer install
374 image: friendicaci/php8.0:php8.0.5
376 - export COMPOSER_HOME=.composer
377 - ./bin/composer.phar validate
378 - ./bin/composer.phar install --prefer-dist
379 - name: Rebuild cache
380 image: meltwater/drone-cache:dev
382 backend: "filesystem"
384 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
385 archive_format: "gzip"
391 - name: Test Friendica
392 image: friendicaci/php8.0:php8.0.5
394 MYSQL_HOST: "mariadb"
396 MYSQL_DATABASE: "test"
397 MYSQL_PASSWORD: "test"
400 MEMCACHED_HOST: "memcached"
401 MEMCACHE_HOST: "memcached"
403 - cp config/local-sample.config.php config/local.config.php
404 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
405 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
406 - phpunit --configuration tests/phpunit.xml
410 image: mariadb:latest
412 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
413 MYSQL_DATABASE: "test"
414 MYSQL_PASSWORD: "test"
428 path: /tmp/drone-cache
432 name: continuous-deployment
441 - friendica/friendica
449 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
452 - name: Restore cache
453 image: meltwater/drone-cache:dev
455 backend: "filesystem"
457 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
458 archive_format: "gzip"
465 - name: Composer install
466 image: friendicaci/php7.4:php7.4.18
468 - export COMPOSER_HOME=.composer
470 - composer install --no-dev --optimize-autoloader
471 - name: Create artifacts
475 - apt-get install bzip2
477 - export VERSION="$(cat VERSION)"
479 - export RELEASE="friendica-full-$VERSION"
480 - export ARTIFACT="$RELEASE.tar.gz"
482 --transform "s,^,$RELEASE/,"
483 -X mods/release-list-exclude.txt
484 -T mods/release-list-include.txt
485 -cvzf ./build/$ARTIFACT
486 - # calculate SHA256 checksum
488 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
491 - # output the sha256 sum for checking
492 - cat "$ARTIFACT.sum256"
493 - sha256sum "$ARTIFACT"
494 - name: Sign artifacts
495 image: plugins/gpgsign
500 from_secret: gpg_password
506 - name: Upload artifacts
510 from_secret: sftp_host
512 from_secret: sftp_user
519 - apk add lftp openssh openssl
521 - chmod 400 drone.key
522 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
525 set net:max-retries 2;
526 set net:reconnect-interval-base 5;
527 set sftp:auto-confirm true;
528 set sftp:connect-program 'ssh -q -a -x -i drone.key';
529 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
538 path: /tmp/drone-cache
542 name: release-deployment
551 - friendica/friendica
558 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
561 - name: Restore cache
562 image: meltwater/drone-cache:dev
564 backend: "filesystem"
566 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
567 archive_format: "gzip"
574 - name: Composer install
575 image: friendicaci/php7.4:php7.4.18
577 - export COMPOSER_HOME=.composer
579 - composer install --no-dev --optimize-autoloader
580 - name: Create artifacts
584 - apt-get install bzip2
586 - export VERSION="$(cat VERSION)"
588 - export RELEASE="friendica-full-$VERSION"
589 - export ARTIFACT="$RELEASE.tar.gz"
591 --transform "s,^,$RELEASE/,"
592 -X mods/release-list-exclude.txt
593 -T mods/release-list-include.txt
594 -cvzf ./build/$ARTIFACT
595 - # calculate SHA256 checksum
597 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
600 - # output the sha256 sum for checking
601 - cat "$ARTIFACT.sum256"
602 - sha256sum "$ARTIFACT"
603 - name: Sign artifacts
604 image: plugins/gpgsign
609 from_secret: gpg_password
615 - name: Upload artifacts
619 from_secret: sftp_host
621 from_secret: sftp_user
628 - apk add lftp openssh openssl
630 - chmod 400 drone.key
631 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
634 set net:max-retries 2;
635 set net:reconnect-interval-base 5;
636 set sftp:auto-confirm true;
637 set sftp:connect-program 'ssh -q -a -x -i drone.key';
638 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
647 path: /tmp/drone-cache