fix: YML
continuous-integration/drone/push Build is passing Details

develop
Gong 2023-08-29 14:55:28 +08:00
parent 4ba2566ae2
commit 3fb08bd38f
2 changed files with 29 additions and 29 deletions

View File

@ -3,8 +3,8 @@ type: docker # 当前管道的类型
name: test # 当前管道的名称
# ****************** 直接丢掉 默认会直接拉代码 ******************
clone:
disable: true #禁用默认克隆
#clone:
# disable: true #禁用默认克隆
steps: # 定义管道的执行步骤
# - name: clone-test
@ -16,32 +16,32 @@ steps: # 定义管道的执行步骤
# - ls -a
# ****************** 直接丢掉 默认会直接拉代码 ******************
# - name: build # 步骤名称
# image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: composer:latest 这里还是使用自己的环境 否则可能一些依赖版本问题会出现这里的composer是 2.5.4 版本
# commands: # 当前步骤执行的命令
# - composer -v
# - ls -a
# - composer install -v
# - ls -a
#
# - name: deploy-push-images
# depends_on: # 依赖build管道
# - build
# image: plugins/docker
# settings:
# repo: gong921123/hyperf # 推送到dockerhub仓库去
# registry: docker.io
# insecure: true # 不使用https
# username:
# from_secret: docker_username
# password:
# from_secret: docker_password
# dockerfile: docker/Dockerfile
# tags: latest
- name: build # 步骤名称
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: composer:latest 这里还是使用自己的环境 否则可能一些依赖版本问题会出现这里的composer是 2.5.4 版本
commands: # 当前步骤执行的命令
- composer -v
- ls -a
- composer install -v
- ls -a
- name: deploy-push-images
depends_on: # 依赖build管道
- build
image: plugins/docker
settings:
repo: gong921123/hyperf # 推送到dockerhub仓库去
registry: docker.io
insecure: true # 不使用https
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: docker/Dockerfile
tags: latest
- name: deploy-pull-project
# depends_on:
# - deploy-push-images
depends_on:
- deploy-push-images
image: appleboy/drone-ssh
settings:
host: gong.cool
@ -53,11 +53,11 @@ steps: # 定义管道的执行步骤
port: 22
script:
- echo ====开始部署=======
# - docker pull gong921123/hyperf:latest
- docker pull gong921123/hyperf:latest
# - 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:80 -v /usr/local/var/www/hyperf:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true gong921123/hyperf:latest
# - docker exec -it gong921123/hyperf /bin/bash
- docker exec -it gong921123/hyperf /bin/bash
# - cd var/www
# - php bin/hyperf.php start
- echo ====部署成功=======

View File

@ -5,4 +5,4 @@ FROM gong921123/debian-nginx-php114-74:latest
# test
COPY . /var/www
ENTRYPOINT ["php", "/opt/www/bin/hyperf.php", "start"]
ENTRYPOINT ["php", "/var/www/bin/hyperf.php", "start"]