3 name: Check messages.po
6 - name: Run default Xgettext
7 image: friendicaci/transifex
9 - ./bin/run_xgettext.sh
12 image: friendicaci/transifex
24 - ./bin/composer.phar run lint
34 - ./bin/composer.phar run lint
44 - ./bin/composer.phar run lint
56 image: meltwater/drone-cache:dev
60 cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}'
61 archive_format: "gzip"
67 - name: Install dependencies
70 - export COMPOSER_HOME=.composer
71 - ./bin/composer.phar run cs:install
73 image: meltwater/drone-cache:dev
77 cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}'
78 archive_format: "gzip"
84 - name: Run coding standards check
85 image: friendicaci/php-cs
87 - export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2)"
93 path: /tmp/drone-cache
103 - name: Restore cache
104 image: meltwater/drone-cache:dev
106 backend: "filesystem"
108 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
109 archive_format: "gzip"
115 - name: Composer install
116 image: friendicaci/php7.3:php7.3.28
118 - export COMPOSER_HOME=.composer
119 - ./bin/composer.phar validate
120 - ./bin/composer.phar install --prefer-dist
121 - name: Rebuild cache
122 image: meltwater/drone-cache:dev
124 backend: "filesystem"
126 cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
127 archive_format: "gzip"
133 - name: Test Friendica
134 image: friendicaci/php7.3:php7.3.28
136 MYSQL_HOST: "mariadb"
138 MYSQL_DATABASE: "test"
139 MYSQL_PASSWORD: "test"
142 MEMCACHED_HOST: "memcached"
143 MEMCACHE_HOST: "memcached"
145 - cp config/local-sample.config.php config/local.config.php
146 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
147 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
148 - phpunit --configuration tests/phpunit.xml
152 image: mariadb:latest
154 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
155 MYSQL_DATABASE: "test"
156 MYSQL_PASSWORD: "test"
170 path: /tmp/drone-cache
180 - name: Restore cache
181 image: meltwater/drone-cache:dev
183 backend: "filesystem"
185 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
186 archive_format: "gzip"
192 - name: Composer install
193 image: friendicaci/php7.4:php7.4.18
195 - export COMPOSER_HOME=.composer
196 - ./bin/composer.phar validate
197 - ./bin/composer.phar install --prefer-dist
198 - name: Rebuild cache
199 image: meltwater/drone-cache:dev
201 backend: "filesystem"
203 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
204 archive_format: "gzip"
210 - name: Test Friendica
211 image: friendicaci/php7.4:php7.4.18
213 MYSQL_HOST: "mariadb"
215 MYSQL_DATABASE: "test"
216 MYSQL_PASSWORD: "test"
219 MEMCACHED_HOST: "memcached"
220 MEMCACHE_HOST: "memcached"
221 XDEBUG_MODE: "coverage"
224 - cp config/local-sample.config.php config/local.config.php
225 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
226 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
227 - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
229 image: plugins/codecov
232 - friendica/friendica
235 from_secret: codecov-token
241 image: mariadb:latest
243 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
244 MYSQL_DATABASE: "test"
245 MYSQL_PASSWORD: "test"
259 path: /tmp/drone-cache
269 - name: Restore cache
270 image: meltwater/drone-cache:dev
272 backend: "filesystem"
274 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
275 archive_format: "gzip"
281 - name: Composer install
282 image: friendicaci/php8.0:php8.0.5
284 - export COMPOSER_HOME=.composer
285 - ./bin/composer.phar validate
286 - ./bin/composer.phar install --prefer-dist
287 - name: Rebuild cache
288 image: meltwater/drone-cache:dev
290 backend: "filesystem"
292 cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
293 archive_format: "gzip"
299 - name: Test Friendica
300 image: friendicaci/php8.0:php8.0.5
302 MYSQL_HOST: "mariadb"
304 MYSQL_DATABASE: "test"
305 MYSQL_PASSWORD: "test"
308 MEMCACHED_HOST: "memcached"
309 MEMCACHE_HOST: "memcached"
311 - cp config/local-sample.config.php config/local.config.php
312 - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
313 - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
314 - phpunit --configuration tests/phpunit.xml
318 image: mariadb:latest
320 MYSQL_ALLOW_EMPTY_PASSWORD: "true"
321 MYSQL_DATABASE: "test"
322 MYSQL_PASSWORD: "test"
336 path: /tmp/drone-cache
340 name: continuous-deployment
349 - friendica/friendica
357 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
360 - name: Restore cache
361 image: meltwater/drone-cache:dev
363 backend: "filesystem"
365 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
366 archive_format: "gzip"
373 - name: Composer install
374 image: friendicaci/php7.4:php7.4.18
376 - export COMPOSER_HOME=.composer
378 - composer install --no-dev --optimize-autoloader
379 - name: Create artifacts
383 - apt-get install bzip2
385 - export VERSION="$(cat VERSION)"
387 - export RELEASE="friendica-full-$VERSION"
388 - export ARTIFACT="$RELEASE.tar.gz"
390 --transform "s,^,$RELEASE/,"
391 -X mods/release-list-exclude.txt
392 -T mods/release-list-include.txt
393 -cvjf ./build/$ARTIFACT
394 - # calculate SHA256 checksum
396 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
398 - # output the sha256 sum for checking
399 - cat "$ARTIFACT.sum256"
400 - sha256sum "$ARTIFACT"
401 - name: Upload artifacts
405 from_secret: sftp_host
407 from_secret: sftp_user
414 - apk add lftp openssh openssl
416 - chmod 400 drone.key
417 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
420 set net:max-retries 2;
421 set net:reconnect-interval-base 5;
422 set sftp:auto-confirm true;
423 set sftp:connect-program 'ssh -q -a -x -i drone.key';
424 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
433 path: /tmp/drone-cache
437 name: release-deployment
446 - friendica/friendica
453 node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
456 - name: Restore cache
457 image: meltwater/drone-cache:dev
459 backend: "filesystem"
461 cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
462 archive_format: "gzip"
469 - name: Composer install
470 image: friendicaci/php7.4:php7.4.18
472 - export COMPOSER_HOME=.composer
474 - composer install --no-dev --optimize-autoloader
475 - name: Create artifacts
479 - apt-get install bzip2
481 - export VERSION="$(cat VERSION)"
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 -cvjf ./build/$ARTIFACT
492 - # calculate SHA256 checksum
494 - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
496 - # output the sha256 sum for checking
497 - cat "$ARTIFACT.sum256"
498 - sha256sum "$ARTIFACT"
499 - name: Upload artifacts
503 from_secret: sftp_host
505 from_secret: sftp_user
512 - apk add lftp openssh openssl
514 - chmod 400 drone.key
515 - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
518 set net:max-retries 2;
519 set net:reconnect-interval-base 5;
520 set sftp:auto-confirm true;
521 set sftp:connect-program 'ssh -q -a -x -i drone.key';
522 connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
531 path: /tmp/drone-cache