]> git.mxchange.org Git - friendica-addons.git/blob - .woodpecker/.continuous-deployment.yml
Merge pull request #1224 from nupplaphil/feat/woodpecker
[friendica-addons.git] / .woodpecker / .continuous-deployment.yml
1 matrix:
2   include:
3     - PHP_MAJOR_VERSION: 7.4
4       PHP_VERSION: 7.4.18
5
6 depends_on:
7   - code_standards_check
8   - messages.po_check
9
10 platform: releaser/release # This prevents executing this pipeline at other servers than ci.friendi.ca
11
12 skip_clone: true
13
14 pipeline:
15   clone_friendica_base:
16     image: alpine/git
17     commands:
18       - git clone https://github.com/friendica/friendica.git .
19       - git checkout $CI_COMMIT_BRANCH
20     when:
21       repo: friendica/friendica-addons
22       branch: [ develop, '*-rc' ]
23       event: push
24   clone_friendica_addon:
25     image: alpine/git
26     commands:
27       - git clone $CI_REPO_LINK addon
28       - cd addon/
29       - git checkout $CI_COMMIT_BRANCH
30       - git fetch origin $CI_COMMIT_REF
31       - git merge $CI_COMMIT_SHA
32     when:
33       repo: friendica/friendica-addons
34       branch: [ develop, '*-rc' ]
35       event: push
36   composer_install:
37     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
38     commands:
39       - export COMPOSER_HOME=.composer
40       - composer validate
41       - composer install --no-dev --optimize-autoloader
42     volumes:
43       - /etc/hosts:/etc/hosts
44     when:
45       repo: friendica/friendica-addons
46       branch: [ develop, '*-rc' ]
47       event: push
48   create_artifacts:
49     image: debian
50     commands:
51       - apt-get update
52       - apt-get install bzip2
53       - export VERSION="$(cat VERSION)"
54       - export RELEASE="friendica-addons-$VERSION"
55       - export ARTIFACT="$RELEASE.tar.gz"
56       - mkdir ./build
57       - tar
58         --exclude='.tx'
59         --exclude='.git'
60         --exclude='.editorconfig'
61         --exclude='.gitattributes'
62         --exclude='.gitignore'
63         --exclude='.drone.yml'
64         --exclude='**/*/messages.po'
65         -cvzf ./build/$ARTIFACT addon/
66       - cd ./build
67       - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
68       - chmod 664 ./*
69       - ls -lh
70       - cat "$ARTIFACT.sum256"
71       - sha256sum "$ARTIFACT"
72     when:
73       repo: friendica/friendica-addons
74       branch: [ develop, '*-rc' ]
75       event: push
76   sign_artifacts:
77     image: plugins/gpgsign
78     settings:
79       key:
80         from_secret: gpg_key
81       passphrase:
82         from_secret: gpg_password
83       files:
84         - build/*
85       exclude:
86         - build/*.sum256
87       detach_sign: true
88     when:
89       repo: friendica/friendica-addons
90       branch: [ develop, '*-rc' ]
91       event: push
92   upload_artifacts:
93     image: alpine
94     secrets:
95       - source: sftp_host
96         target: lftp_host
97       - source: sftp_user
98         target: lftp_user
99       - source: ssh_key
100         target: lftp_key
101     environment:
102       LFTP_PORT: "22"
103       LFTP_SOURCE: "build"
104       LFTP_TARGET: "/http"
105     volumes:
106       - /etc/hosts:/etc/hosts
107     commands:
108       - apk add lftp openssh openssl
109       - touch drone.key
110       - chmod 400 drone.key
111       - echo "$LFTP_KEY" | openssl base64 -A -d > drone.key
112       - lftp -c "
113         set net:timeout 5;
114         set net:max-retries 2;
115         set net:reconnect-interval-base 5;
116         set sftp:auto-confirm true;
117         set sftp:connect-program 'ssh -q -a -x -i drone.key';
118         connect sftp://$LFTP_USER:@$LFTP_HOST:$LFTP_PORT;
119         cd $LFTP_TARGET;
120         mput $LFTP_SOURCE/*;
121         "
122       - rm drone.key
123     when:
124       repo: friendica/friendica-addons
125       branch: [ develop, '*-rc' ]
126       event: push