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
119 - name: Restore cache
120 image: meltwater/drone-cache:dev
122 backend: "filesystem"
124 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
125 archive_format: "gzip"
131 - name: Composer install
132 image: friendicaci/php7.3:php7.3.28
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 }}_php73_{{ arch }}_{{ os }}'
143 archive_format: "gzip"
149 - name: Test Friendica
150 image: friendicaci/php7.3:php7.3.28
152 MYSQL_HOST: "mariadb"
154 MYSQL_DATABASE: "test"
155 MYSQL_PASSWORD: "test"
158 MEMCACHED_HOST: "memcached"
159 MEMCACHE_HOST: "memcached"
161 - cp config/local-sample.config.php config/local.config.php
162 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
163 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
164 - phpunit --configuration tests/phpunit.xml
168 image: mariadb:latest
170 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
171 MYSQL_DATABASE: "test"
172 MYSQL_PASSWORD: "test"
186 path: /tmp/drone-cache
196 - name: Restore cache
197 image: meltwater/drone-cache:dev
199 backend: "filesystem"
201 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
202 archive_format: "gzip"
208 - name: Composer install
209 image: friendicaci/php7.4:php7.4.18
211 - export COMPOSER_HOME=.composer
212 - ./bin/composer.phar validate
213 - ./bin/composer.phar install --prefer-dist
214 - name: Rebuild cache
215 image: meltwater/drone-cache:dev
217 backend: "filesystem"
219 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
220 archive_format: "gzip"
226 - name: Test Friendica
227 image: friendicaci/php7.4:php7.4.18
229 MYSQL_HOST: "mariadb"
231 MYSQL_DATABASE: "test"
232 MYSQL_PASSWORD: "test"
235 MEMCACHED_HOST: "memcached"
236 MEMCACHE_HOST: "memcached"
237 XDEBUG_MODE: "coverage"
240 - cp config/local-sample.config.php config/local.config.php
241 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
242 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
243 - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
245 image: plugins/codecov
248 - friendica/friendica
251 from_secret: codecov-token
257 image: mariadb:latest
259 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
260 MYSQL_DATABASE: "test"
261 MYSQL_PASSWORD: "test"
275 path: /tmp/drone-cache
285 - name: Restore cache
286 image: meltwater/drone-cache:dev
288 backend: "filesystem"
290 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
291 archive_format: "gzip"
297 - name: Composer install
298 image: friendicaci/php8.0:php8.0.5
300 - export COMPOSER_HOME=.composer
301 - ./bin/composer.phar validate
302 - ./bin/composer.phar install --prefer-dist
303 - name: Rebuild cache
304 image: meltwater/drone-cache:dev
306 backend: "filesystem"
308 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
309 archive_format: "gzip"
315 - name: Test Friendica
316 image: friendicaci/php8.0:php8.0.5
318 MYSQL_HOST: "mariadb"
320 MYSQL_DATABASE: "test"
321 MYSQL_PASSWORD: "test"
324 MEMCACHED_HOST: "memcached"
325 MEMCACHE_HOST: "memcached"
327 - cp config/local-sample.config.php config/local.config.php
328 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
329 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
330 - phpunit --configuration tests/phpunit.xml
334 image: mariadb:latest
336 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
337 MYSQL_DATABASE: "test"
338 MYSQL_PASSWORD: "test"
352 path: /tmp/drone-cache
356 name: continuous-deployment
365 - friendica/friendica
373 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
376 - name: Restore cache
377 image: meltwater/drone-cache:dev
379 backend: "filesystem"
381 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
382 archive_format: "gzip"
389 - name: Composer install
390 image: friendicaci/php7.4:php7.4.18
392 - export COMPOSER_HOME=.composer
394 - composer install --no-dev --optimize-autoloader
395 - name: Create artifacts
399 - apt-get install bzip2
401 - export VERSION="$(cat VERSION)"
403 - export RELEASE="friendica-full-$VERSION"
404 - export ARTIFACT="$RELEASE.tar.gz"
406 --transform "s,^,$RELEASE/,"
407 -X mods/release-list-exclude.txt
408 -T mods/release-list-include.txt
409 -cvzf ./build/$ARTIFACT
410 - # calculate SHA256 checksum
412 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
415 - # output the sha256 sum for checking
416 - cat "$ARTIFACT.sum256"
417 - sha256sum "$ARTIFACT"
418 - name: Sign artifacts
419 image: plugins/gpgsign
424 from_secret: gpg_password
430 - name: Upload artifacts
434 from_secret: sftp_host
436 from_secret: sftp_user
443 - apk add lftp openssh openssl
445 - chmod 400 drone.key
446 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
449 set net:max-retries 2;
450 set net:reconnect-interval-base 5;
451 set sftp:auto-confirm true;
452 set sftp:connect-program 'ssh -q -a -x -i drone.key';
453 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
462 path: /tmp/drone-cache
466 name: release-deployment
475 - friendica/friendica
482 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
485 - name: Restore cache
486 image: meltwater/drone-cache:dev
488 backend: "filesystem"
490 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
491 archive_format: "gzip"
498 - name: Composer install
499 image: friendicaci/php7.4:php7.4.18
501 - export COMPOSER_HOME=.composer
503 - composer install --no-dev --optimize-autoloader
504 - name: Create artifacts
508 - apt-get install bzip2
510 - export VERSION="$(cat VERSION)"
512 - export RELEASE="friendica-full-$VERSION"
513 - export ARTIFACT="$RELEASE.tar.gz"
515 --transform "s,^,$RELEASE/,"
516 -X mods/release-list-exclude.txt
517 -T mods/release-list-include.txt
518 -cvzf ./build/$ARTIFACT
519 - # calculate SHA256 checksum
521 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
524 - # output the sha256 sum for checking
525 - cat "$ARTIFACT.sum256"
526 - sha256sum "$ARTIFACT"
527 - name: Sign artifacts
528 image: plugins/gpgsign
533 from_secret: gpg_password
539 - name: Upload artifacts
543 from_secret: sftp_host
545 from_secret: sftp_user
552 - apk add lftp openssh openssl
554 - chmod 400 drone.key
555 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
558 set net:max-retries 2;
559 set net:reconnect-interval-base 5;
560 set sftp:auto-confirm true;
561 set sftp:connect-program 'ssh -q -a -x -i drone.key';
562 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
571 path: /tmp/drone-cache