narasiahli-be/.drone.yml

45 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2026-02-18 10:45:34 +00:00
kind: pipeline
2026-02-23 02:22:42 +00:00
type: ssh
2026-02-18 10:45:34 +00:00
name: narasi-ahli-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
2026-03-03 06:45:22 +00:00
commands:
2026-03-03 07:08:04 +00:00
- rm -rf /opt/build/narasiahli-be
- mkdir -p /opt/build/narasiahli-be
2026-03-03 06:45:22 +00:00
- cd /opt/build
- git clone http://38.47.180.165:3000/narasi-ahli/narasiahli-be.git
2026-03-03 07:08:04 +00:00
- cd /opt/build/narasiahli-be
2026-03-03 06:56:06 +00:00
- git checkout $DRONE_BRANCH
2026-02-18 10:45:34 +00:00
- name: build image
when:
branch:
- main
2026-03-03 06:45:22 +00:00
commands:
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
2026-03-03 07:08:04 +00:00
- cd /opt/build/narasiahli-be
- docker build -t 38.47.180.165:3000/narasi-ahli/narasiahli-be:$DRONE_BRANCH .
- docker push 38.47.180.165:3000/narasi-ahli/narasiahli-be:$DRONE_BRANCH
2026-02-18 10:45:34 +00:00
- name: deploy
when:
branch:
- main
2026-03-03 06:45:22 +00:00
commands:
2026-03-03 07:08:04 +00:00
- docker pull 38.47.180.165:3000/narasi-ahli/narasiahli-be:$DRONE_BRANCH
2026-03-03 06:45:22 +00:00
- docker stop narasi-ahli-be || true
- docker rm narasi-ahli-be || true
2026-03-03 07:08:04 +00:00
- docker run -dt -e TZ=Asia/Jakarta -p 8801:8800 --restart always --name narasi-ahli-be 38.47.180.165:3000/narasi-ahli/narasiahli-be:$DRONE_BRANCH