From c2cd12bc65c63964b7c315d231bf83453b72b7e1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 12:13:14 +0200 Subject: [PATCH 01/11] Add drone release for addons --- .drone.yml | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/.drone.yml b/.drone.yml index 4e3239f5c..adb54a858 100644 --- a/.drone.yml +++ b/.drone.yml @@ -69,3 +69,92 @@ steps: - 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 +--- +kind: pipeline +type: docker +name: php-continous-package + +#trigger: +# repo: +# - friendica/friendica-addons +# branch: +# - develop +# - 20*-rc +# event: +# - push + +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 RELEASEADDONS="friendica-addons-$VERSION" + - export ARTIFACTADDONS="$RELEASEADDON.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' \ + -cvjf ./build/$ARTIFACTADDONS --transform "s,^addon,$RELEASEADDONS," addon/ + - # calculate SHA256 checksum + - sha256sum ./build/$ARTIFACTADDONS > ./build/$ARTIFACTADDONS.sha256 + - ls -lh ./build + - 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 From 3bb47c5845e1af4cbe5b029d0dc38e3db6c0d7b6 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 12:17:03 +0200 Subject: [PATCH 02/11] Add drone release for addons --- .drone.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index adb54a858..456c348f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -114,13 +114,13 @@ steps: - mkdir ./build - # Create artifact for friendica-addons - tar \ - --exclude='./.tx' \ - --exclude='./.git' \ - --exclude='./.editorconfig' \ - --exclude='./.gitattributes' \ - --exclude='./.gitignore' \ - --exclude='./.drone.yml' \ - --exclude='./**/*/messages.po' \ + --exclude='./.tx' + --exclude='./.git' + --exclude='./.editorconfig' + --exclude='./.gitattributes' + --exclude='./.gitignore' + --exclude='./.drone.yml' + --exclude='./**/*/messages.po' -cvjf ./build/$ARTIFACTADDONS --transform "s,^addon,$RELEASEADDONS," addon/ - # calculate SHA256 checksum - sha256sum ./build/$ARTIFACTADDONS > ./build/$ARTIFACTADDONS.sha256 From 826fa888433cf5a99c60fabe8017436b5730a651 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 12:18:44 +0200 Subject: [PATCH 03/11] Add drone release for addons --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 456c348f0..e26f987c6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -113,7 +113,7 @@ steps: - export ARTIFACTADDONS="$RELEASEADDON.tar.gz" - mkdir ./build - # Create artifact for friendica-addons - - tar \ + - tar --exclude='./.tx' --exclude='./.git' --exclude='./.editorconfig' From 5bba4bee0096ccb8a12554fc7edcaa43929ab52f Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 12:22:42 +0200 Subject: [PATCH 04/11] Add drone release for addons --- .drone.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index e26f987c6..238cd958c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -109,21 +109,21 @@ steps: - apt-get update - apt-get install bzip2 - export VERSION="$(cat VERSION)" - - export RELEASEADDONS="friendica-addons-$VERSION" - - export ARTIFACTADDONS="$RELEASEADDON.tar.gz" + - 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' - -cvjf ./build/$ARTIFACTADDONS --transform "s,^addon,$RELEASEADDONS," addon/ + --exclude='.tx' + --exclude='.git' + --exclude='.editorconfig' + --exclude='.gitattributes' + --exclude='.gitignore' + --exclude='.drone.yml' + --exclude='**/*/messages.po' + -cvjf ./build/$ARTIFACT --transform "s,^addon,$RELEASE," addon/ - # calculate SHA256 checksum - - sha256sum ./build/$ARTIFACTADDONS > ./build/$ARTIFACTADDONS.sha256 + - sha256sum ./build/$ARTIFACT > ./build/$ARTIFACT.sha256 - ls -lh ./build - name: Upload artifacts image: alpine From f51828c996e4f5e9970b474cdb5a019ef8e8c5f1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 12:52:17 +0200 Subject: [PATCH 05/11] Add stable releaser --- .drone.yml | 104 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 238cd958c..aee6a8ccd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -74,14 +74,102 @@ kind: pipeline type: docker name: php-continous-package -#trigger: -# repo: -# - friendica/friendica-addons -# branch: -# - develop -# - 20*-rc -# event: -# - push +trigger: + repo: + - friendica/friendica-addons + branch: + - develop + - 20*-rc + event: + - push + +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' + -cvjf ./build/$ARTIFACT --transform "s,^addon,$RELEASE," addon/ + - # calculate SHA256 checksum + - sha256sum ./build/$ARTIFACT > ./build/$ARTIFACT.sha256 + - ls -lh ./build + - 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 +name: php-release-package + +trigger: + repo: + - friendica/friendica-addons + branch: + - stable + event: + - tag node: node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca From 6164c8416c7c970b597c030f8b65aad6a6fb2741 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 17:05:40 +0200 Subject: [PATCH 06/11] Adapt sha256 generation --- .drone.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index aee6a8ccd..044acce5c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -123,8 +123,12 @@ steps: --exclude='**/*/messages.po' -cvjf ./build/$ARTIFACT --transform "s,^addon,$RELEASE," addon/ - # calculate SHA256 checksum - - sha256sum ./build/$ARTIFACT > ./build/$ARTIFACT.sha256 - - ls -lh ./build + - cd ./build + - sha256sum "$ARTIFACT" > "$ARTIFACT.sha256" + - ls -lh + - # output the sha256 sum for checking purpose + - cat "$ARTIFACT.sha256" + - sha256sum "$ARTIFACT" - name: Upload artifacts image: alpine environment: @@ -211,8 +215,12 @@ steps: --exclude='**/*/messages.po' -cvjf ./build/$ARTIFACT --transform "s,^addon,$RELEASE," addon/ - # calculate SHA256 checksum - - sha256sum ./build/$ARTIFACT > ./build/$ARTIFACT.sha256 - - ls -lh ./build + - cd ./build + - sha256sum "$ARTIFACT" > "$ARTIFACT.sha256" + - ls -lh + - # output the sha256 sum for checking purpose + - cat "$ARTIFACT.sha256" + - sha256sum "$ARTIFACT" - name: Upload artifacts image: alpine environment: From 0ef95fdb750bcb5fb65586709791d5da26761467 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 2 Sep 2021 20:06:31 +0200 Subject: [PATCH 07/11] keep the foldername "addon" --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 044acce5c..c0c2ac022 100644 --- a/.drone.yml +++ b/.drone.yml @@ -121,7 +121,7 @@ steps: --exclude='.gitignore' --exclude='.drone.yml' --exclude='**/*/messages.po' - -cvjf ./build/$ARTIFACT --transform "s,^addon,$RELEASE," addon/ + -cvjf ./build/$ARTIFACT addon/ - # calculate SHA256 checksum - cd ./build - sha256sum "$ARTIFACT" > "$ARTIFACT.sha256" @@ -213,7 +213,7 @@ steps: --exclude='.gitignore' --exclude='.drone.yml' --exclude='**/*/messages.po' - -cvjf ./build/$ARTIFACT --transform "s,^addon,$RELEASE," addon/ + -cvjf ./build/$ARTIFACT addon/ - # calculate SHA256 checksum - cd ./build - sha256sum "$ARTIFACT" > "$ARTIFACT.sha256" From 07b3dd20ab10af89a353f632d8cce3d705cfa9a9 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 3 Sep 2021 09:22:42 +0200 Subject: [PATCH 08/11] Renamings --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index c0c2ac022..bac21a40d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -72,7 +72,7 @@ steps: --- kind: pipeline type: docker -name: php-continous-package +name: continous-deployment trigger: repo: @@ -165,7 +165,7 @@ volumes: --- kind: pipeline type: docker -name: php-release-package +name: release-deployment trigger: repo: From 3b9fc39241f946bfab39db205a44605077421577 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 3 Sep 2021 09:24:27 +0200 Subject: [PATCH 09/11] Temporary deactivate restrictions --- .drone.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index bac21a40d..9c4966bae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -74,14 +74,14 @@ kind: pipeline type: docker name: continous-deployment -trigger: - repo: - - friendica/friendica-addons - branch: - - develop - - 20*-rc - event: - - push +#trigger: +# repo: +# - friendica/friendica-addons +# branch: +# - develop +# - 20*-rc +# event: +# - push node: node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca From d65d42cff28a534cf3ad55367ddcab2e6b2e2956 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 3 Sep 2021 09:25:11 +0200 Subject: [PATCH 10/11] Reactivate Trigger --- .drone.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9c4966bae..bac21a40d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -74,14 +74,14 @@ kind: pipeline type: docker name: continous-deployment -#trigger: -# repo: -# - friendica/friendica-addons -# branch: -# - develop -# - 20*-rc -# event: -# - push +trigger: + repo: + - friendica/friendica-addons + branch: + - develop + - 20*-rc + event: + - push node: node: releaser # This prevents executing this pipeline at other servers than drone.friendi.ca From 322186d82d073949c2fc9d5eee3d129538a7328d Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 3 Sep 2021 15:31:44 +0200 Subject: [PATCH 11/11] Update .drone.yml Co-authored-by: Hypolite Petovan --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index bac21a40d..08a1b71df 100644 --- a/.drone.yml +++ b/.drone.yml @@ -72,7 +72,7 @@ steps: --- kind: pipeline type: docker -name: continous-deployment +name: continuous-deployment trigger: repo: