phptest/cicd/.drone.yml
wangjun 0c38448943
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
修改部署标签
2021-10-20 13:24:50 +08:00

63 lines
1.3 KiB
YAML

---
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: uat-${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
...