From 81f50b625b8ed0b84594768cc299bdbd03b34641 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Thu, 24 Oct 2019 10:24:42 -0700 Subject: [PATCH 1/2] Separate branch and tag pipelines --- .drone.yml | 122 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 107 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9356e416c0d..1caa46ec2cb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,7 +20,7 @@ steps: --- kind: pipeline -name: docker +name: docker-branch platform: os: linux @@ -31,7 +31,7 @@ steps: image: plugins/docker settings: dockerfile: Dockerfile - tag: ${DRONE_TAG=$DRONE_BRANCH} + tag: ${DRONE_BRANCH} repo: rancherlabs/dashboard username: from_secret: docker_username @@ -42,14 +42,38 @@ steps: include: - "refs/heads/master" - "refs/heads/*-dev" - - "refs/tags/v*" event: - push + +--- +kind: pipeline +name: docker-tag + +platform: + os: linux + arch: amd64 + +steps: +- name: docker-image + image: plugins/docker + settings: + dockerfile: Dockerfile + tag: ${DRONE_TAG} + repo: rancherlabs/dashboard + username: + from_secret: docker_username + password: + from_secret: docker_password + when: + ref: + include: + - "refs/tags/v*" + event: - tag --- kind: pipeline -name: hosted +name: hosted-branch platform: os: linux arch: amd64 @@ -65,10 +89,8 @@ steps: include: - "refs/heads/master" - "refs/heads/*-dev" - - "refs/tags/*" event: - push - - tag - name: upload pull: default @@ -77,8 +99,8 @@ steps: acl: - allUsers:READER cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_TAG=$DRONE_BRANCH} - target: releases.rancher.com/dashboard/${DRONE_TAG=$DRONE_BRANCH} + source: dist/${DRONE_BRANCH} + target: releases.rancher.com/dashboard/${DRONE_BRANCH} token: from_secret: google_auth_key when: @@ -86,14 +108,50 @@ steps: include: - "refs/heads/master" - "refs/heads/*-dev" - - "refs/tags/*" event: - push + +--- +kind: pipeline +name: hosted-tag +platform: + os: linux + arch: amd64 + +steps: +- name: build + pull: default + image: node:10 + commands: + - ./scripts/build-hosted + when: + ref: + include: + - "refs/tags/*" + event: + - tag + +- name: upload + pull: default + image: plugins/gcs + settings: + acl: + - allUsers:READER + cache_control: "no-cache,must-revalidate" + source: dist/${DRONE_TAG} + target: releases.rancher.com/dashboard/${DRONE_TAG} + token: + from_secret: google_auth_key + when: + ref: + include: + - "refs/tags/*" + event: - tag --- kind: pipeline -name: embedded +name: embedded-branch platform: os: linux arch: amd64 @@ -109,10 +167,8 @@ steps: include: - "refs/heads/master" - "refs/heads/*-dev" - - "refs/tags/*" event: - push - - tag - name: upload pull: default @@ -121,8 +177,8 @@ steps: acl: - allUsers:READER cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_TAG=$DRONE_BRANCH}.tar.gz - target: releases.rancher.com/dashboard/${DRONE_TAG=$DRONE_BRANCH}.tar.gz + source: dist/${DRONE_BRANCH}.tar.gz + target: releases.rancher.com/dashboard/${DRONE_BRANCH}.tar.gz token: from_secret: google_auth_key when: @@ -130,7 +186,43 @@ steps: include: - "refs/heads/master" - "refs/heads/*-dev" - - "refs/tags/*" event: - push + +--- +kind: pipeline +name: embedded-tag +platform: + os: linux + arch: amd64 + +steps: +- name: build + pull: default + image: node:10 + commands: + - ./scripts/build-embedded + when: + ref: + include: + - "refs/tags/*" + event: + - tag + +- name: upload + pull: default + image: plugins/gcs + settings: + acl: + - allUsers:READER + cache_control: "no-cache,must-revalidate" + source: dist/${DRONE_TAG}.tar.gz + target: releases.rancher.com/dashboard/${DRONE_TAG}.tar.gz + token: + from_secret: google_auth_key + when: + ref: + include: + - "refs/tags/*" + event: - tag From 78c7132e830333c9c14b45d9b9e389390ce767be Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Thu, 24 Oct 2019 10:38:43 -0700 Subject: [PATCH 2/2] Move triggers to pipeline --- .drone.yml | 131 +++++++++++++++++++++++++---------------------------- 1 file changed, 61 insertions(+), 70 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1caa46ec2cb..5bb06a4879e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,12 @@ kind: pipeline name: test +trigger: + event: + - push + - pull_request + - tag + platform: os: linux arch: amd64 @@ -12,16 +18,21 @@ steps: image: node:10 commands: - scripts/ci - when: - event: - - push - - pull_request - - tag --- kind: pipeline name: docker-branch +depends_on: +- test + +trigger: + ref: + - "refs/heads/master" + - "refs/heads/*-dev" + event: + - push + platform: os: linux arch: amd64 @@ -37,18 +48,18 @@ steps: from_secret: docker_username password: from_secret: docker_password - when: - ref: - include: - - "refs/heads/master" - - "refs/heads/*-dev" - event: - - push --- kind: pipeline name: docker-tag +depends_on: +- test + +trigger: + event: + - tag + platform: os: linux arch: amd64 @@ -64,16 +75,21 @@ steps: from_secret: docker_username password: from_secret: docker_password - when: - ref: - include: - - "refs/tags/v*" - event: - - tag --- kind: pipeline name: hosted-branch + +depends_on: +- test + +trigger: + ref: + - "refs/heads/master" + - "refs/heads/*-dev" + event: + - push + platform: os: linux arch: amd64 @@ -84,13 +100,6 @@ steps: image: node:10 commands: - ./scripts/build-hosted - when: - ref: - include: - - "refs/heads/master" - - "refs/heads/*-dev" - event: - - push - name: upload pull: default @@ -103,17 +112,18 @@ steps: target: releases.rancher.com/dashboard/${DRONE_BRANCH} token: from_secret: google_auth_key - when: - ref: - include: - - "refs/heads/master" - - "refs/heads/*-dev" - event: - - push --- kind: pipeline name: hosted-tag + +depends_on: +- test + +trigger: + event: + - tag + platform: os: linux arch: amd64 @@ -124,12 +134,6 @@ steps: image: node:10 commands: - ./scripts/build-hosted - when: - ref: - include: - - "refs/tags/*" - event: - - tag - name: upload pull: default @@ -142,16 +146,21 @@ steps: target: releases.rancher.com/dashboard/${DRONE_TAG} token: from_secret: google_auth_key - when: - ref: - include: - - "refs/tags/*" - event: - - tag --- kind: pipeline name: embedded-branch + +depends_on: +- test + +trigger: + ref: + - "refs/heads/master" + - "refs/heads/*-dev" + event: + - push + platform: os: linux arch: amd64 @@ -162,13 +171,6 @@ steps: image: node:10 commands: - ./scripts/build-embedded - when: - ref: - include: - - "refs/heads/master" - - "refs/heads/*-dev" - event: - - push - name: upload pull: default @@ -181,17 +183,18 @@ steps: target: releases.rancher.com/dashboard/${DRONE_BRANCH}.tar.gz token: from_secret: google_auth_key - when: - ref: - include: - - "refs/heads/master" - - "refs/heads/*-dev" - event: - - push --- kind: pipeline name: embedded-tag + +depends_on: +- test + +trigger: + event: + - tag + platform: os: linux arch: amd64 @@ -202,12 +205,6 @@ steps: image: node:10 commands: - ./scripts/build-embedded - when: - ref: - include: - - "refs/tags/*" - event: - - tag - name: upload pull: default @@ -220,9 +217,3 @@ steps: target: releases.rancher.com/dashboard/${DRONE_TAG}.tar.gz token: from_secret: google_auth_key - when: - ref: - include: - - "refs/tags/*" - event: - - tag