Skip to content

A Demo to show workflow of Drone CI + GitFlow + Semantic Release + Kubernetes

Notifications You must be signed in to change notification settings

AlloVince/drone-ci-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Demo to show workflow of Drone CI + GitFlow + Semantic Release + Kubernetes

Build Status

Step by step, to show how to build a powerful team development workflow with CI

Step 0: Hello world

  1. Use drone cloud or setup a private drone by k8s

Kubernetes config files under ./kubernetes

  1. prepare .drone.yml
kind: pipeline
name: deploy

steps:
- name: hello-world
  image: docker
  commands:
    - echo "hello world"

Step 1: For single person, manually release

  1. Add a secret in Drone, key is DOCKER_PASSWORD, value is your docker registry password

  2. prepare .drone.yml

kind: pipeline
name: deploy

steps:
  - name: unit-test
    image: node:10
    commands:
      - node test/index.js
    when:
      branch: master
      event: push
  - name: build-image
    image: plugins/docker
    settings:
      repo: allovince/drone-ci-demo
      username: allovince
      password:
        from_secret: DOCKER_PASSWORD
      auto_tag: true
    when:
      event: tag
  1. push to master branch will trigger unit test

  2. manually release on github will trigger building docker image

Step 2: For team develop, support GitFlow

Change .drone.yml as this

Step 3: For team develop, support GitFlow, with semantic-release

Change .drone.yml as this