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