kontenhumas-be/.drone.yml

42 lines
1.1 KiB
YAML
Raw Permalink Normal View History

2026-02-19 08:29:26 +00:00
kind: pipeline
type: ssh
name: kontenhumas-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/kontenhumas-be
2026-02-19 08:35:56 +00:00
- mkdir -p /opt/build
- cd /opt/build
2026-02-19 08:29:26 +00:00
- git clone http://38.47.180.165:3000/kontenhumas/kontenhumas-be.git
- name: build image
when:
branch:
- main
commands:
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
2026-02-19 08:31:41 +00:00
- cd /opt/build/kontenhumas-be
2026-02-19 08:29:26 +00:00
- docker build -t 38.47.180.165:3000/kontenhumas/kontenhumas-be:$DRONE_BRANCH .
- docker push 38.47.180.165:3000/kontenhumas/kontenhumas-be:$DRONE_BRANCH
- name: deploy
when:
branch:
- main
commands:
- docker pull 38.47.180.165:3000/kontenhumas/kontenhumas-be:$DRONE_BRANCH
- docker stop netidhub-saas-be || true
- docker rm netidhub-saas-be || true
- docker run -dt -p 8809:8800 --restart always --name netidhub-saas-be 38.47.180.165:3000/kontenhumas/kontenhumas-be:$DRONE_BRANCH