parent
cbbbf85977
commit
7096ac1150
|
|
@ -1,13 +0,0 @@
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: test
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: print-message
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- echo "This is a test message from Drone CI"
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
57
.drone.yml
57
.drone.yml
|
|
@ -3,59 +3,12 @@ type: docker
|
||||||
name: test
|
name: test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: print-message
|
||||||
image: gong921123/debian-nginx-php114-74:latest
|
image: alpine
|
||||||
pull: if-not-exists
|
|
||||||
commands:
|
commands:
|
||||||
- composer -v
|
- echo "This is a test message from Drone CI"
|
||||||
- ls -a
|
|
||||||
- composer install -v
|
|
||||||
|
|
||||||
- name: deploy-push-images
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
image: plugins/docker
|
|
||||||
pull: if-not-exists
|
|
||||||
settings:
|
|
||||||
repo: gong921123/hyperfa
|
|
||||||
registry: docker.io
|
|
||||||
insecure: true
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
dockerfile: docker/Dockerfile
|
|
||||||
tags: ${DRONE_TAG}
|
|
||||||
|
|
||||||
- name: deploy-pull-project
|
|
||||||
depends_on:
|
|
||||||
- deploy-push-images
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
pull: if-not-exists
|
|
||||||
settings:
|
|
||||||
host: 106.15.233.223
|
|
||||||
user:
|
|
||||||
from_secret: ssh_username
|
|
||||||
password:
|
|
||||||
from_secret: ssh_password
|
|
||||||
command_timeout: 5m
|
|
||||||
port: 22
|
|
||||||
script:
|
|
||||||
- echo ====开始部署=======
|
|
||||||
- docker pull gong921123/hyperfa:${DRONE_TAG}
|
|
||||||
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
|
|
||||||
- docker rm $(docker ps | grep hyperf | awk '{print $1}')
|
|
||||||
- docker rmi $(docker images | grep gong921123/hyperf | awk '{print $3}')
|
|
||||||
- docker rmi $(docker images | grep "<none>" | awk '{print $3}')
|
|
||||||
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d
|
|
||||||
- -v /etc/hosts:/etc/hosts --privileged=true gong921123/hyperfa:${DRONE_TAG}
|
|
||||||
- echo ====部署成功=======
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
|
|
||||||
|
|
||||||
# branch:
|
|
||||||
# - develop
|
|
||||||
event:
|
event:
|
||||||
- tag
|
# - tag
|
||||||
# - push
|
- push
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue