fix: test8
continuous-integration/drone/push Build encountered an error Details

develop
Unshift 2024-11-22 10:04:55 +08:00
parent a7e82b7c91
commit 9ea38d93fe
2 changed files with 36 additions and 61 deletions

View File

@ -1,36 +1,15 @@
kind: pipeline
type: kubernetes
name: testing
name: dev
node_selector:
aisimu: dev-tag
# kubectl label nodes ecs-7fd5-1118132 aisimu=dev-tag 给节点打标签
# kubectl get nodes --show-labels 查看节点标签
steps:
- name: build
image: registry.cn-shanghai.aliyuncs.com/gong92-socl/hy-test-k8s
image: composer:latest
commands:
- ls
- composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
- composer install -v
- name: deploy-push-images
depends_on:
- build
image: plugins/docker
pull: if-not-exists
settings:
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/hy-test-k8s
registry: registry.cn-shanghai.aliyuncs.com
insecure: true
username:
from_secret: aliyun_docker_name
password:
from_secret: aliyun_docker_password
dockerfile: docker/Dockerfile
trigger:
# branch:
# - develop
event:
# - tag
- push

View File

@ -1,40 +1,36 @@
kind: pipeline # 定义一个管道
type: docker # 当前管道的类型
name: test # 当前管道的名称
clone:
disable: true #禁用默认克隆
steps: # 定义管道的执行步骤
- name: clone-test
image: alpine/git
kind: pipeline
type: kubernetes
name: testing
node_selector:
aisimu: dev-tag
# kubectl label nodes ecs-7fd5-1118132 aisimu=dev-tag 给节点打标签
# kubectl get nodes --show-labels 查看节点标签
steps:
- name: build
image: composer:latest
commands:
- git clone http://gong.cool:3001/gong/hyperf.git #自定义克隆地址
- git version
- pwd
- ls -a
- name: build # 步骤名称
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: docker/compose
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的文件夹文件按照绝对路径写到这个文件中。
- ls
- composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
- composer install -v
- ls -a
- name: deploy-push-images
image: plugins/docker
settings:
repo: gong921123/drone-docker-test # 推送到dockerhub仓库去
registry: docker.io
insecure: true # 不使用https
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: hyperf/docker/Dockerfile
tags: latest
- name: deploy-push-images
depends_on:
- build
image: plugins/docker
pull: if-not-exists
settings:
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/hy-test-k8s
registry: registry.cn-shanghai.aliyuncs.com
insecure: true
username:
from_secret: aliyun_docker_name
password:
from_secret: aliyun_docker_password
dockerfile: docker/Dockerfile
trigger:
# branch:
# - develop
event:
# - tag
- push