2021-05-17 15:40:14 -04:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Check messages.po
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: clone friendica base
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone https://github.com/friendica/friendica.git .
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- name: clone friendica addon
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
2021-05-21 16:16:36 -04:00
|
|
|
- git clone $DRONE_REPO_LINK addon
|
|
|
|
- cd addon/
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- git fetch origin $DRONE_COMMIT_REF
|
|
|
|
- git merge $DRONE_COMMIT_SHA
|
|
|
|
- name: Run Xgettext for addons
|
2021-05-17 15:40:14 -04:00
|
|
|
image: friendicaci/transifex
|
|
|
|
commands:
|
2021-05-21 16:16:36 -04:00
|
|
|
- /xgettext-addon.sh
|
2021-05-17 15:40:14 -04:00
|
|
|
- name: Check update necessary
|
2021-05-21 16:16:36 -04:00
|
|
|
image: friendicaci/transifex
|
2021-05-17 15:40:14 -04:00
|
|
|
commands:
|
2021-05-21 16:16:36 -04:00
|
|
|
- /check-addons.sh
|
2021-05-22 08:12:19 -04:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: php-cs check
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
steps:
|
2021-05-22 17:43:18 -04:00
|
|
|
- name: Clone friendica base
|
2021-05-22 08:12:19 -04:00
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone https://github.com/friendica/friendica.git .
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
2021-05-22 17:43:22 -04:00
|
|
|
- name: Clone friendica addon
|
2021-05-22 08:12:19 -04:00
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone $DRONE_REPO_LINK addon
|
|
|
|
- cd addon/
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- git fetch origin $DRONE_COMMIT_REF
|
|
|
|
- git merge $DRONE_COMMIT_SHA
|
|
|
|
- name: Install dependencies
|
|
|
|
image: composer
|
|
|
|
commands:
|
|
|
|
- ./bin/composer.phar run cs:install
|
|
|
|
- name: Run coding standards check
|
|
|
|
image: friendicaci/php-cs
|
|
|
|
commands:
|
|
|
|
- cd addon/
|
|
|
|
- export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")"
|
|
|
|
- cd ../
|
|
|
|
- /check-php-cs.sh
|
2021-09-02 06:13:14 -04:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2021-09-03 09:31:44 -04:00
|
|
|
name: continuous-deployment
|
2021-09-02 06:13:14 -04:00
|
|
|
|
2021-09-03 03:25:11 -04:00
|
|
|
trigger:
|
|
|
|
repo:
|
|
|
|
- friendica/friendica-addons
|
|
|
|
branch:
|
|
|
|
- develop
|
|
|
|
- 20*-rc
|
|
|
|
event:
|
|
|
|
- push
|
2021-09-02 06:52:17 -04:00
|
|
|
|
|
|
|
node:
|
|
|
|
node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone friendica base
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone https://github.com/friendica/friendica.git .
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- name: Clone friendica addon
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone $DRONE_REPO_LINK addon
|
|
|
|
- cd addon/
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- git fetch origin $DRONE_COMMIT_REF
|
|
|
|
- git merge $DRONE_COMMIT_SHA
|
|
|
|
- name: Create artifacts
|
|
|
|
image: debian
|
|
|
|
commands:
|
|
|
|
- apt-get update
|
|
|
|
- apt-get install bzip2
|
|
|
|
- export VERSION="$(cat VERSION)"
|
|
|
|
- export RELEASE="friendica-addons-$VERSION"
|
|
|
|
- export ARTIFACT="$RELEASE.tar.gz"
|
|
|
|
- mkdir ./build
|
|
|
|
- # Create artifact for friendica-addons
|
|
|
|
- tar
|
|
|
|
--exclude='.tx'
|
|
|
|
--exclude='.git'
|
|
|
|
--exclude='.editorconfig'
|
|
|
|
--exclude='.gitattributes'
|
|
|
|
--exclude='.gitignore'
|
|
|
|
--exclude='.drone.yml'
|
|
|
|
--exclude='**/*/messages.po'
|
2021-09-02 14:06:31 -04:00
|
|
|
-cvjf ./build/$ARTIFACT addon/
|
2021-09-02 06:52:17 -04:00
|
|
|
- # calculate SHA256 checksum
|
2021-09-02 11:05:40 -04:00
|
|
|
- cd ./build
|
2021-09-03 15:30:33 -04:00
|
|
|
- sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
|
2021-09-02 11:05:40 -04:00
|
|
|
- ls -lh
|
2021-09-08 15:54:36 -04:00
|
|
|
- # output the sha256 sum for checking
|
2021-09-03 15:30:33 -04:00
|
|
|
- cat "$ARTIFACT.sum256"
|
2021-09-02 11:05:40 -04:00
|
|
|
- sha256sum "$ARTIFACT"
|
2021-09-08 15:54:36 -04:00
|
|
|
- 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
|
2021-09-02 06:52:17 -04:00
|
|
|
- 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
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2021-09-03 03:22:42 -04:00
|
|
|
name: release-deployment
|
2021-09-02 06:52:17 -04:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
repo:
|
|
|
|
- friendica/friendica-addons
|
|
|
|
branch:
|
|
|
|
- stable
|
|
|
|
event:
|
|
|
|
- tag
|
2021-09-02 06:13:14 -04:00
|
|
|
|
|
|
|
node:
|
|
|
|
node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone friendica base
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone https://github.com/friendica/friendica.git .
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- name: Clone friendica addon
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git clone $DRONE_REPO_LINK addon
|
|
|
|
- cd addon/
|
|
|
|
- git checkout $DRONE_COMMIT_BRANCH
|
|
|
|
- git fetch origin $DRONE_COMMIT_REF
|
|
|
|
- git merge $DRONE_COMMIT_SHA
|
|
|
|
- name: Create artifacts
|
|
|
|
image: debian
|
|
|
|
commands:
|
|
|
|
- apt-get update
|
|
|
|
- apt-get install bzip2
|
|
|
|
- export VERSION="$(cat VERSION)"
|
2021-09-02 06:22:42 -04:00
|
|
|
- export RELEASE="friendica-addons-$VERSION"
|
|
|
|
- export ARTIFACT="$RELEASE.tar.gz"
|
2021-09-02 06:13:14 -04:00
|
|
|
- mkdir ./build
|
|
|
|
- # Create artifact for friendica-addons
|
2021-09-02 06:18:44 -04:00
|
|
|
- tar
|
2021-09-02 06:22:42 -04:00
|
|
|
--exclude='.tx'
|
|
|
|
--exclude='.git'
|
|
|
|
--exclude='.editorconfig'
|
|
|
|
--exclude='.gitattributes'
|
|
|
|
--exclude='.gitignore'
|
|
|
|
--exclude='.drone.yml'
|
|
|
|
--exclude='**/*/messages.po'
|
2021-09-02 14:06:31 -04:00
|
|
|
-cvjf ./build/$ARTIFACT addon/
|
2021-09-02 06:13:14 -04:00
|
|
|
- # calculate SHA256 checksum
|
2021-09-02 11:05:40 -04:00
|
|
|
- cd ./build
|
2021-09-03 15:30:33 -04:00
|
|
|
- sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
|
2021-09-02 11:05:40 -04:00
|
|
|
- ls -lh
|
2021-09-08 15:54:36 -04:00
|
|
|
- # output the sha256 sum for checking
|
2021-09-03 15:30:33 -04:00
|
|
|
- cat "$ARTIFACT.sum256"
|
2021-09-02 11:05:40 -04:00
|
|
|
- sha256sum "$ARTIFACT"
|
2021-09-08 15:54:36 -04:00
|
|
|
- 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
|
2021-09-02 06:13:14 -04:00
|
|
|
- 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
|