/
.drone.yml
78 lines (70 loc) · 2.09 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
kind: pipeline
type: docker
name: test
steps:
- name: Test Go
image: golang:1.22
commands:
- cp .env.example .env
- touch /drone/src/server/static/gen/main.js
- touch /drone/src/server/static/gen/main.css
- curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-$(dpkg --print-architecture)" > "${HOME}/bin/cc-test-reporter"
- chmod +x "${HOME}/bin/cc-test-reporter"
- cc-test-reporter before-build
- bin/test.sh
- exitcode="$?"
- cc-test-reporter after-build --exit-code "$exitcode"
environment:
CC_TEST_REPORTER_ID: a80cd7d0697a40f38985bf79bc5aec83b6c742ed8d3463b42388b972a0b99443
- name: Test Node
image: satantime/puppeteer-node:21-bookworm-slim
commands:
- cp .env.example .env
- npm ci
- npm test
- name: Test Bash
image: koalaman/shellcheck-alpine:stable
commands:
- cp .env.example .env
- shellcheck -x --exclude=SC1091 bin/*.sh
- name: Test Dockerfile
image: hadolint/hadolint:latest-alpine
commands:
- hadolint Dockerfile --ignore=DL3008 --ignore=DL4006 --ignore=SC2046 --ignore=SC2006
- name: Test Nginx
image: python:3.12-alpine
commands:
- pip install gixy==0.1.20 pyparsing==2.4.7
- gixy config/nginx/*
- name: Test Makefile
image: cytopia/checkmake:latest
commands:
- checkmake Makefile
- name: Build Docker Container
depends_on:
- Test Go
- Test Node
- Test Bash
- Test Dockerfile
- Test Makefile
- Test Nginx
image: plugins/docker
settings:
repo: reaction-pics
tags: test
dry_run: true
- name: Deploy
depends_on:
- Build Docker Container
environment:
SSH_KEY:
from_secret: ssh_key
image: albertyw/ssh-client:4.1.2
commands:
- ssh-keyscan direct.albertyw.com >> /root/.ssh/known_hosts
- echo "$${SSH_KEY}" > /root/.ssh/id_ed25519
- chmod 600 /root/.ssh/id_ed25519
- ssh albertyw@direct.albertyw.com reaction-pics/bin/deploy.sh master
when:
branch:
- master