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