-
Notifications
You must be signed in to change notification settings - Fork 15
/
.drone.yml
92 lines (86 loc) · 2.68 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
kind: pipeline
type: docker
name: docs
trigger: { event: [ push ], branch: [ v2 ] }
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive --depth 1
- printf $(git rev-parse --abbrev-ref HEAD) > BRANCH
- cat BRANCH
- name: docs
image: ghcr.io/hackbg/fadroma:v2
volumes:
- { name: cache, path: /data/ci-cache }
- { name: docs, path: /var/www/docs.hack.bg }
commands:
- export BRANCH="$(cat BRANCH | tr '/' '_' | tr '\n' ' ')"
- echo $BRANCH
- mkdir -vp "/data/ci-cache/fadroma-docs-$BRANCH"
- rm -rvf node_modules
- ln -vs "/data/ci-cache/fadroma-docs-$BRANCH" node_modules
- touch node_modules/.magic
- mkdir -vp "/data/ci-cache/pnpm-store-v3"
- rm -rvf ~/.local/share/pnpm
- mkdir -p ~/.local/share/pnpm/store
- ln -s "/data/ci-cache/pnpm-store-v3" ~/.local/share/pnpm/store/v3
- corepack enable
- pnpm i --no-frozen-lockfile --strict-peer-dependencies
- pnpm docs:typedoc
- du -sh ./docs
- mkdir -p /var/www/docs.hack.bg
- cp -r docs /var/www/docs.hack.bg/fadroma~
- rm -rf /var/www/docs.hack.bg/fadroma
- mv /var/www/docs.hack.bg/fadroma~ /var/www/docs.hack.bg/fadroma
environment:
FORCE_COLOR: 2
volumes:
- { name: cache, host: { path: /data/ci-cache } }
- { name: docs, host: { path: /var/www/docs.hack.bg } }
---
kind: pipeline
type: docker
name: test
trigger: { event: [ push ], branch: [ v2 ] }
services:
- name: docker
image: docker:24.0.7-alpine3.18
privileged: true
environment:
# Temporary docker daemon:
DATA: "/var/lib/docker"
HOST: "tcp://0.0.0.0:2375"
MIRROR: "http://127.0.0.1:5000"
commands:
- dockerd --dns 1.1.1.1 --rootless=true --bridge=none --iptables=false --data-root "$DATA" --host="$HOST" --registry-mirror "$MIRROR"
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive --depth 1
- printf $(git rev-parse --abbrev-ref HEAD) > BRANCH
- cat BRANCH
- name: test
image: ghcr.io/hackbg/fadroma:v2
volumes: [ { name: cache, path: "/data/ci-cache" } ]
environment:
DOCKER_HOST: "tcp://docker:2375"
commands:
- export BRANCH="$(cat BRANCH | tr '/' '_' | tr '\n' ' ')"
- echo $BRANCH
- mkdir -vp "/data/ci-cache/fadroma-test-$BRANCH"
- rm -rvf node_modules
- ln -vs "/data/ci-cache/fadroma-test-$BRANCH" node_modules
- touch node_modules/.magic
- mkdir -vp "/data/ci-cache/pnpm-store-v3"
- rm -rvf ~/.local/share/pnpm
- mkdir -p ~/.local/share/pnpm/store
- ln -s "/data/ci-cache/pnpm-store-v3" ~/.local/share/pnpm/store/v3
- pnpm i --no-frozen-lockfile --strict-peer-dependencies
- pnpm cov all
environment:
FORCE_COLOR: 2
volumes:
- { name: cache, host: { path: /data/ci-cache } }