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