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