3 changed files with 54 additions and 9 deletions
@ -0,0 +1,49 @@ |
|||||
|
workspace: |
||||
|
base: /project |
||||
|
path: src/demo |
||||
|
|
||||
|
branches: [ master,develop,uat ] |
||||
|
|
||||
|
|
||||
|
pipeline: |
||||
|
|
||||
|
build: |
||||
|
image: golang:1.20-alpine |
||||
|
commands: |
||||
|
- export GO111MODULE=on |
||||
|
- export GOPROXY=https://goproxy.cn,direct |
||||
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server.app |
||||
|
# - make build |
||||
|
|
||||
|
docker-dev: |
||||
|
image: plugins/docker |
||||
|
repo: registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller |
||||
|
registry: registry.cn-shenzhen.aliyuncs.com |
||||
|
use_cache: true |
||||
|
dockerfile: Dockerfile |
||||
|
secrets: [ docker_username, docker_password ] |
||||
|
tags: app-api |
||||
|
when: |
||||
|
branch: develop |
||||
|
|
||||
|
# deploy-dev: |
||||
|
# image: roffe/kubectl |
||||
|
# commands: |
||||
|
# - rm -rf /root/.kube && cp -r .kube /root |
||||
|
# - kubectl delete -f deployDev.yaml || true |
||||
|
# - kubectl apply -f deployDev.yaml |
||||
|
# when: |
||||
|
# branch: develop |
||||
|
deploy-dev: |
||||
|
image: appleboy/drone-ssh |
||||
|
host: 1.92.109.79 |
||||
|
username: root |
||||
|
password: |
||||
|
from_secret: ssh_password |
||||
|
port: 22 # 可选,指定 SSH 端口,默认为 22 |
||||
|
script: |
||||
|
- docker rm -f app-api |
||||
|
- docker pull registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller:app-api |
||||
|
- docker run --name=app-api -p 30201:8001 -d registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller:app-api |
||||
|
when: |
||||
|
branch: develop |
Loading…
Reference in new issue