备注:
需要进行drone 以及gitlab 环境的配置,可以参考相关资料
1. 参考项目
https://github.com/rongfengliang/drone-appdemo
2. drone 构建配置(使用docker && s3 插件)
pipeline:
backend:
image: golang
commands:
- go build
- go test
- ls .
frontend:
image: node:6
commands:
- npm install
- npm test
docker:
group: deploy
image: plugins/docker
registry: youprivatedockerregistry # i use harbor
repo: youprivatedockerregistry/droneci/drone-demoapp
dockerfile: Dockerfile
username: dockerpush # harbor username
password: Dockerpushpassword # harbor userpassword
s3push:
group: deploy
image: plugins/s3
bucket: droneproject
source: ./**
access_key: access_key
secret_key: secret_key
target: /drone-appdemo
region: us-west-1
path_style: true
endpoint: you minio address # my minio address
说明:
比较简单,主要是私有harbor 以及minio 的配置
minio 的搭建可以参考:
https://github.com/rongfengliang/mino-thumbor-openresty
项目尽管有点负复杂,但是使用docker-compose 直接就可以起来,比较简单,实际上项目可能需要类似的方案
比如进行发布直接使用minio会是一个比较好的方案
3. 效果
4. 参考资料
https://github.com/rongfengliang/drone-appdemo
https://github.com/rongfengliang/mino-thumbor-openresty
http://plugins.drone.io/drone-plugins/drone-docker/
http://plugins.drone.io/drone-plugins/drone-s3/