develop
Gong 2023-08-28 17:23:20 +08:00
parent 1453e95a89
commit a6a518b015
1 changed files with 34 additions and 22 deletions

View File

@ -1,6 +1,8 @@
kind: pipeline # 定义一个管道 kind: pipeline # 定义一个管道
type: docker # 当前管道的类型 type: docker # 当前管道的类型
name: test # 当前管道的名称 name: test # 当前管道的名称
# ****************** 直接丢掉 默认会直接拉代码 ******************
#clone: #clone:
# disable: true #禁用默认克隆 # disable: true #禁用默认克隆
@ -12,35 +14,45 @@ steps: # 定义管道的执行步骤
# - git version # - git version
# - pwd # - pwd
# - ls -a # - ls -a
- name: build # 步骤名称 # ****************** 直接丢掉 默认会直接拉代码 ******************
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: composer:latest 这里还是使用自己的环境 否则可能一些依赖版本问题会出现
commands: # 当前步骤执行的命令
- composer -v
- ls -a
- composer install -v
- ls -a
- name: deploy-push-images
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: pull_image # - name: build # 步骤名称
# image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: composer:latest 这里还是使用自己的环境 否则可能一些依赖版本问题会出现
# commands: # 当前步骤执行的命令
# - composer -v
# - ls -a
# - composer install -v
# - ls -a
# - name: deploy-push-images
# image: plugins/docker # image: plugins/docker
# settings: # settings:
# repo: gong921123/hyperf # 推送到dockerhub仓库去
# registry: docker.io
# insecure: true # 不使用https
# username: # username:
# from_secret: docker_username # from_secret: docker_username
# password: # password:
# from_secret: docker_password # from_secret: docker_password
# commands: # dockerfile: docker/Dockerfile
# - docker pull gong921123/hyperf:v0.0.1 # tags: latest
- name: pull_image
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
commands:
- docker pull gong921123/hyperf:latest
- name: start_container
image: docker
commands:
- docker-compose up -d
- name: run_hyperf
image: docker
commands:
- docker-compose exec -T gong921123/hyperf:latest php bin/hyperf.php
trigger: # 触发条件,并关系 trigger: # 触发条件,并关系
branch: # git 分支 branch: # git 分支