47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: autoDispatchDeploy
|
|
steps:
|
|
|
|
# 项目打包并发布
|
|
- name: autoDispatchBuild
|
|
pull: if-not-exists
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
commands:
|
|
- cd AutoDispathingWork
|
|
- dotnet publish -c Release -o ../release
|
|
- name: push
|
|
image: plugins/docker
|
|
pull: if-not-exists
|
|
depends_on: [ autoDispatchBuild ]
|
|
settings:
|
|
dockerfile: ./AutoDispathingWork/Dockerfile
|
|
username:
|
|
from_secret: local_registry_username
|
|
password:
|
|
from_secret: local_registry_password
|
|
tags:
|
|
- latest
|
|
registry: 192.168.100.10:5000
|
|
insecure: true
|
|
repo: 192.168.100.10:5000/autodispatch/web
|
|
- name: deploy
|
|
image: appleboy/drone-ssh
|
|
depends_on: [ ZhiLiaoWebApiBuild,ZhiLiaoWebApiPush ]
|
|
settings:
|
|
host:
|
|
from_secret: server_host
|
|
user:
|
|
from_secret: server_username
|
|
password:
|
|
from_secret: server_password
|
|
port: 22
|
|
command_timeout: 2m
|
|
script:
|
|
- docker stop autodispatch
|
|
- docker rm autodispatch
|
|
- docker rmi 121.4.75.240:5000/autodispatch/web
|
|
- docker pull 121.4.75.240:5000/autodispatch/web
|
|
- docker run -d --name autodispatch -p 88:80 121.4.75.240:5000/autodispatch/web
|
|
|