hyperf/.drone.yml

59 lines
2.2 KiB
YAML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

kind: pipeline # 定义一个管道
type: docker # 当前管道的类型
name: test # 当前管道的名称
clone:
disable: true #禁用默认克隆
steps: # 定义管道的执行步骤
- name: clone-test
image: alpine/git
commands:
- git clone http://gong.cool:3001/gitea/hyperf.git #自定义克隆地址 http://gong.cool:3001/gitea/hyperf.git
- git version
- pwd
- ls -a
- name: build # 步骤名称
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: composer:latest 这里还是使用自己的环境 否则可能一些依赖版本问题会出现
commands: # 当前步骤执行的命令
- composer -v
- ls -a
- cd hyperf
#- composer require firebase/php-jwt # 没有composer.json 和 lock文件
# 如果第一次使用composer 就使用composer require 包名,可以自动创建 vend 和对应的文件
# 当然这是在本地的时候去创建【本地有了 拉取代码的时候 才能去执行自动拉取】 拉取代码的时候 直接composer install 即可
# 本地的endor文件 不需要上传到git上需要创建一个 .gitignore 文件 把不需要上传git的文件夹文件按照绝对路径写到这个文件中。
- composer install -v
- ls -a
- name: deploy-push-images
image: plugins/docker
settings:
repo: gong921123/hyperf # 推送到dockerhub仓库去
registry: docker.io
insecure: true # 不使用https
auto_tag: true
tag: v0.0.1
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: hyperf/docker/Dockerfile
# - name: pull_image
# image: plugins/docker
# settings:
# username:
# from_secret: docker_username
# password:
# from_secret: docker_password
# commands:
# - docker pull gong921123/hyperf:v0.0.1
trigger: # 触发条件,并关系
branch: # git 分支
- develop
- master
event: # 事件
- push
# - tag