fixing drone
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Anang Yusman 2026-02-19 11:46:34 +08:00
parent 5a5c40839e
commit c027c84c16
1 changed files with 6 additions and 19 deletions

View File

@ -2,9 +2,6 @@ kind: pipeline
type: ssh type: ssh
name: arah-negeri-build-deploy name: arah-negeri-build-deploy
clone:
disable: true
server: server:
host: host:
from_secret: ssh_host from_secret: ssh_host
@ -24,32 +21,22 @@ steps:
- cd /opt/build - cd /opt/build
- git clone http://38.47.180.165:3000/medol/web-arah-negeri.git - git clone http://38.47.180.165:3000/medol/web-arah-negeri.git
- name: build fe
commands:
- export NVM_DIR="$HOME/.nvm"
- source ~/.nvm/nvm.sh
- nvm use 18
- node -v
- npm install --legacy-peer-deps
- npm run build
- name: build image - name: build image
when: when:
branch: branch:
- main - main
commands: commands:
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0 - docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
- cd /opt/build/web-arah-negeri - cd /opt/build/web-arah-negeri
- docker compose build - docker build -t 38.47.180.165:3000/medol/arah-negeri:$DRONE_BRANCH .
- docker push 38.47.180.165:3000/medol/web-arah-negeri.git:$DRONE_BRANCH - docker push 38.47.180.165:3000/medol/arah-negeri:$DRONE_BRANCH
- name: deploy - name: deploy
when: when:
branch: branch:
- main - main
commands: commands:
- docker pull 38.47.180.165:3000/medol/web-arah-negeri:$DRONE_BRANCH - docker pull 38.47.180.165:3000/medol/arah-negeri:$DRONE_BRANCH
- docker stop web-arah-negeri || true - docker stop new-web-arah-negeri || true
- docker rm web-arah-negeri || true - docker rm new-web-arah-negeri || true
- sudo docker run -dt -p 4252:3000 --restart always --name web-arah-negeri 38.47.185.86:8900/medols/web-arah-negeri:dev:$DRONE_BRANCH - docker run -dt -p 4252:3000 --restart always --name new-web-arah-negeri 38.47.180.165:3000/medol/arah-negeri:$DRONE_BRANCH