update drone
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Anang Yusman 2026-04-02 13:09:53 +08:00
parent dd013322fe
commit 8d34d6e424
1 changed files with 43 additions and 0 deletions

43
.drone.yml Normal file
View File

@ -0,0 +1,43 @@
kind: pipeline
type: ssh
name: medols-be-build-deploy
server:
host:
from_secret: ssh_host
user:
from_secret: ssh_user
ssh_key:
from_secret: ssh_key
steps:
- name: prepare repo
when:
branch:
- main
commands:
- rm -rf /opt/build/medols-be
- mkdir -p /opt/build/medols-be
- cd /opt/build/medols-be
- git clone http://38.47.180.165:3000/medol/medol-be.git
- name: build image
when:
branch:
- main
commands:
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
- cd /opt/build/medol/medol-be
- docker build -t 38.47.180.165:3000/medol/medol-be:main .
- docker push 38.47.180.165:3000/medol/medol-be:main
- name: deploy
when:
branch:
- main
commands:
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
- docker pull 38.47.180.165:3000/medol/medol-be:main
- docker stop medol-be || true
- docker rm medol-be || true
- docker run -dt -p 8810:8800 --name medol-be 38.47.180.165:3000/medol/medol-be:main