generated from albertyw/base-flask
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
73 lines (66 loc) · 2.15 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
kind: pipeline
type: docker
name: test
steps:
- name: Test Python
image: python:3.13-slim-bookworm
commands:
- apt-get update && apt-get install -y curl git
- ln -fs .env.development .env
- pip install -e .[test]
- 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"
- ruff check .
- gunicorn -c config/gunicorn.conf.py --check-config
- mypy .
- cc-test-reporter before-build
- coverage run -m unittest discover
- exitcode="$?"
- coverage report -m
- coverage xml -i
- cc-test-reporter after-build --exit-code "$exitcode"
environment:
CC_TEST_REPORTER_ID: 2fd1548c4a64215b1a8790e4cf423b329dda550bcf437b5e5835c16fd0da332b
- name: Test Node
image: satantime/puppeteer-node:23-bookworm-slim
commands:
- apt-get update && apt-get install -y xz-utils # Remove when https://github.com/satanTime/puppeteer-node/issues/26 is resolved
- ln -fs .env.development .env
- npm ci
- npm test
- name: Test Bash
image: koalaman/shellcheck-alpine:stable
commands:
- ln -fs .env.development .env
- shellcheck -x bin/*.sh
- name: Test Dockerfile
image: hadolint/hadolint:latest-alpine
commands:
- hadolint Dockerfile --ignore=DL3008 --ignore=SC2046 --ignore=SC2006
- name: Test Nginx
image: albertyw/gixy:0.2.2
commands:
- gixy config/nginx/*
- name: Build Docker Container
depends_on:
- Test Dockerfile
image: plugins/docker:20
settings:
repo: chase-center-calendar
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.1
commands:
- ssh-keyscan direct.albertyw.com >> /root/.ssh/known_hosts
- echo "$${SSH_KEY}" > /root/.ssh/id_ed25519
- chmod 600 /root/.ssh/id_ed25519
- ssh [email protected] chase-center-calendar/bin/deploy.sh master
when:
branch:
- master