drone 1.0 新的构建徽章特性

drone 1.0 昨天新发布的功能,支持了一个方便的查看构建状态的功能徽章
如下:

环境准备

  • docker-compose 文件
version: '3'
services:
  drone-server:
    image: drone/drone:1.0.0-rc.1
    ports:
      - "80:80"
    volumes:
      - ./drone:/var/lib/drone/
    environment:
      - DRONE_OPEN=true
      - DRONE_SERVER_HOST=drone-server
      - DRONE_DEBUG=true
      - DRONE_GIT_ALWAYS_AUTH=false
      - DRONE_GOGS=true
      - DRONE_GOGS_SKIP_VERIFY=false
      - DRONE_GOGS_SERVER=http://gogs:3000
      - DRONE_PROVIDER=gogs
      - DRONE_DATABASE_DATASOURCE=/var/lib/drone/drone.sqlite
      - DRONE_DATABASE_DRIVER=sqlite3
      - DRONE_SERVER_PROTO=http
      - DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
  gogs:
    image: gogs/gogs
    ports:
      - "10022:22"
      - "3000:3000"
    volumes:
      - ./data/gogs:/data
    depends_on:
      - mysql
  mysql:
    image: mysql:5.7.16
    volumes:
      - ./gogs/mysql:/var/lib/mysql
    ports:
      - 3308:3306
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: dalongrong
      MYSQL_DATABASE: gogs
      MYSQL_USER: gogs
      MYSQL_PASSWORD: dalongrong
      TZ: Asia/Shanghai
  drone-agent:
    image: drone/agent:1.0.0-rc.1
    depends_on:
      - drone-server
    environment:
      - DRONE_RPC_SERVER=http://drone-server
      - DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
      - DRONE_DEBUG=true
      - DOCKER_HOST=tcp://docker-bind:2375
  docker-bind:
     image: docker:dind
     privileged: true
     command: --storage-driver=overlay ## 注意修改为实际操作系统的信息
  • 启动&&配置
docker-compose up -d 
配置gogs ,直接配置就可以了,简单简单
  • 创建简单git 项目并添加drone pipeline 配置文件
kind: pipeline
name: default
steps:
- name: info
  image: busybox
  commands:
  - echo "appdemo"

配置drone&&测试

  • 配置drone

    徽章信息

    git 项目添加徽章信息
# first
[![Build Status](http://10.15.0.66/api/badges/dalong/first/status.svg)](http://10.15.0.66/dalong/first)
  • 效果

posted on 2018-11-16 14:31  荣锋亮  阅读(899)  评论(0编辑  收藏  举报

导航