forked from qzq1111/flask-restful-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
65 lines (59 loc) · 1.18 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
kind: pipeline
name: default
steps:
# 代码分析
- name: code-analysis
image: aosapps/drone-sonar-plugin
settings:
sonar_host:
from_secret: sonar_host
sonar_token:
from_secret: sonar_token
# 测试
- name: test
image: python:3
commands:
- pip install -r requirements.txt
- pytest
# 构建代码docker镜像
- name: code-build
image: plugins/docker
settings:
registry:
from_secret: docker_registry
repo:
from_secret: docker_repo
username:
from_secret: docker_name
password:
from_secret: docker_password
tags:
- latest
- '1.0'
# 将部署文件放入指定目录
- name: code-scp
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
port: 22
password:
from_secret: ssh_password
target: /projects/ci_test
source: docker-compose.yaml
# 部署项目
- name: code-deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
port: 22
password:
from_secret: ssh_password
script:
- cd /projects/ci_test
- docker-compose up -d