- - name: memcached-php7.1
- image: friendicaci/php7.1:php7.1.32
- commands:
- - phpenmod xdebug
- - sleep 20
- - NOINSTALL=true TEST_SELECTION=MEMCACHED ./autotest.sh
- - wget https://codecov.io/bash -O codecov.sh
- - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 2f4b253b-ca17-41d7-96e3-81623581c97d -f tests/autotest-clover.xml; fi"
- - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 2f4b253b-ca17-41d7-96e3-81623581c97d -f tests/autotest-clover.xml; fi"
- environment:
- MEMCACHED_HOST: memcached
-
-services:
- - name: memcached
- image: memcached
-
-#trigger:
-# branch:
-# - master
-# - develop
-# - "*-rc"
-# event:
-# - pull_request
-# - push
+ - name: Restore cache
+ image: meltwater/drone-cache:dev
+ settings:
+ backend: "filesystem"
+ restore: true
+ cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
+ archive_format: "gzip"
+ mount:
+ - '.composer'
+ volumes:
+ - name: cache
+ path:
+ /tmp/cache
+ - name: Composer install
+ image: friendicaci/php7.4:php7.4.18
+ commands:
+ - export COMPOSER_HOME=.composer
+ - composer validate
+ - composer install --no-dev --optimize-autoloader
+ - name: Create artifacts
+ image: debian
+ commands:
+ - apt-get update
+ - apt-get install bzip2
+ - mkdir ./build
+ - export VERSION="$(cat VERSION)"
+ - # Create artifact
+ - export RELEASE="friendica-full-$VERSION"
+ - export ARTIFACT="$RELEASE.tar.gz"
+ - tar
+ --transform "s,^,$RELEASE/,"
+ -X mods/release-list-exclude.txt
+ -T mods/release-list-include.txt
+ -cvzf ./build/$ARTIFACT
+ - # calculate SHA256 checksum
+ - cd ./build
+ - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
+ - chmod 664 ./*
+ - ls -lh
+ - # output the sha256 sum for checking
+ - cat "$ARTIFACT.sum256"
+ - sha256sum "$ARTIFACT"
+ - name: Sign artifacts
+ image: plugins/gpgsign
+ settings:
+ key:
+ from_secret: gpg_key
+ passphrase:
+ from_secret: gpg_password
+ files:
+ - build/*
+ exclude:
+ - build/*.sum256
+ detach_sign: true
+ - name: Upload artifacts
+ image: alpine
+ environment:
+ LFTP_HOST:
+ from_secret: sftp_host
+ LFTP_USER:
+ from_secret: sftp_user
+ LFTP_KEY:
+ from_secret: ssh_key
+ LFTP_PORT: "22"
+ LFTP_SOURCE: "build"
+ LFTP_TARGET: "/http"
+ commands:
+ - apk add lftp openssh openssl
+ - touch drone.key
+ - chmod 400 drone.key
+ - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
+ - lftp -c "
+ set net:timeout 5;
+ set net:max-retries 2;
+ set net:reconnect-interval-base 5;
+ set sftp:auto-confirm true;
+ set sftp:connect-program 'ssh -q -a -x -i drone.key';
+ connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
+ cd $LFTP_TARGET;
+ mput $LFTP_SOURCE/*;
+ "
+ - rm drone.key
+
+volumes:
+ - name: cache
+ host:
+ path: /tmp/drone-cache