feat: add drone.yml
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
5ad79e75e2
commit
0ab1674513
|
|
@ -0,0 +1,42 @@
|
|||
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
|
||||
- mkdir -p /opt/build/kontenhumas-be
|
||||
- cd /opt/build/kontenhumas-be
|
||||
- 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
|
||||
- cd /opt/build/kontenhumas/kontenhumas-be
|
||||
- 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
|
||||
Loading…
Reference in New Issue