From ba48bd96cec1b3a4abb5e841ebd73a8639e3c4fb Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Wed, 18 Feb 2026 17:45:34 +0700 Subject: [PATCH] feat:drone --- .drone.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..48ac8f6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,42 @@ +kind: pipeline +type: ssh +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 + commands: + - rm -rf /opt/build/narasi-ahli-be + - mkdir -p /opt/build/narasi-ahli-be + - cd /opt/build/narasi-ahli-be + - git clone http://38.47.180.165:3000/narasi-ahli/narasi-ahli-be.git + + - name: build image + when: + branch: + - main + commands: + - docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0 + - cd /opt/build/narasi-ahli-be + - docker build -t 38.47.180.165:3000/narasi-ahli/narasi-ahli-be:$DRONE_BRANCH . + - docker push 38.47.180.165:3000/narasi-ahli/narasi-ahli-be:$DRONE_BRANCH + + - name: deploy + when: + branch: + - main + commands: + - docker pull 38.47.180.165:3000/narasi-ahli/narasi-ahli-be:$DRONE_BRANCH + - docker stop new-web-narasi-ahli-be || true + - docker rm new-web-narasi-ahli-be || true + - docker run -dt -e TZ=Asia/Jakarta -p 4500:4000 --restart always --name narasi-ahli-be 38.47.180.165:3000/narasi-ahli/narasi-ahli-be:$DRONE_BRANCH