fix drone
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ebb80113fb
commit
b19ef9060a
|
|
@ -0,0 +1,42 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: bhayangkara-kita-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/web-bhayangkara-kita
|
||||||
|
- mkdir -p /opt/build
|
||||||
|
- cd /opt/build
|
||||||
|
- git clone http://38.47.180.165:3000/medol/web-bhayangkara-kita.git
|
||||||
|
|
||||||
|
- name: build image
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
commands:
|
||||||
|
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
|
||||||
|
- cd /opt/build/web-bhayangkara-kita
|
||||||
|
- docker build -t 38.47.180.165:3000/medol/bhayangkara-kita:$DRONE_BRANCH .
|
||||||
|
- docker push 38.47.180.165:3000/medol/bhayangkara-kita:$DRONE_BRANCH
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
commands:
|
||||||
|
- docker pull 38.47.180.165:3000/medol/bhayangkara-kita:$DRONE_BRANCH
|
||||||
|
- docker stop web-bhayangkara-kita || true
|
||||||
|
- docker rm web-bhayangkara-kita || true
|
||||||
|
- docker run -dt -p 4249:3000 --restart always --name web-bhayangkara-kita 38.47.180.165:3000/medol/bhayangkara-kita:$DRONE_BRANCH
|
||||||
Loading…
Reference in New Issue