-
Notifications
You must be signed in to change notification settings - Fork 18
/
.drone.yml
48 lines (44 loc) · 1.03 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
kind: pipeline
name: demo
steps:
- name: build
image: golang:1.18.2
commands:
- pwd
- go version
- go build .
- go test demo/util
# - name: frontend
# image: node:6
# commands:
# - npm install
# - npm test
- name: publish
image: plugins/docker:latest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: example/demo
tags: latest
- name: deploy
image: appleboy/drone-ssh
pull: true
settings:
host: kanda.me
user: cpp
key:
from_secret: deploy_key
script:
- cd /data/
- mkdir app/
- cd /data/app
- docker rmi -f example/demo
- echo "login docker"
# - docker login --username ${DOCKER_USER} --password ${DOCKER_SEC}
- echo "login success, pulling..."
- docker pull example/demo:latest
- echo "image running"
- docker run -p 8088:8088 -d example/demo
- echo "run success"