test
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
wangjun 2021-10-19 18:45:42 +08:00
parent f12f317710
commit 3cae759fe1
2 changed files with 64 additions and 0 deletions

62
cicd/.drone.yml Normal file
View File

@ -0,0 +1,62 @@
---
kind: pipeline
type: docker
name: wangjun/phptest
trigger:
ref:
- refs/heads/master
- refs/heads/dev
- refs/heads/uat
- refs/tags/v*
steps:
# 测试环境
- name: phptest-docker
image: plugins/docker
when:
branch:
- master
settings:
dockerfile: cicd/Dockerfile
repo: registry.amtcloud.cn/wangjun/phptest
tags:
- prod-${DRONE_BUILD_NUMBER}
registry: registry.amtcloud.cn
username:
from_secret: user_registry_amtcloud
password:
from_secret: psw_registry_amtcloud
build_args:
- TARGET=master
# 测试环境部署
- name: phptest-deploy
image: nobugtodebug/kustomit:latest
when:
branch:
- master
commands:
- cd /app && python main.py
settings:
git_user:
from_secret: drone_gitea
git_password:
from_secret: psw_drone_gitea
project_path: ${DRONE_REPO}
target_env: prod
image_name: registry.amtcloud.cn/wangjun/phptest
image_tag: prod-${DRONE_BUILD_NUMBER}
ref_commit: ${DRONE_COMMIT}
ref_author: ${DRONE_COMMIT_AUTHOR}
# 挂载的主机卷,可以映射到插件的容器中
volumes:
- name: docker-cache
host:
path: /data_store/docker_root
- name: docker-sock
host:
path: /var/run/docker.sock
...

2
cicd/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM php:7.2-apache
COPY index.php /var/www/html/