mirror of https://github.com/k3d-io/k3d
[Enhancement] Improved CI with Drone (#278)
* Misc: cleanup and restructure Makefile * Misc: use dind output target in Dockerfile * tests/e2e: ensure that the docker runner is really up before continuing * CI: add drone * Misc: fix image tag for e2e in Makefile * CI/drone: add build step, step conditionals and restrict to linux platform * CI/drone: add docs pipeline * Misc: allow setting e2e runner timeout via Makefile arg * CI/drone: add target platform for docs pipeline * CI: Goodbye travis * Misc: add drone make target to run drone CI locally * CI/drone: add basic pipelines for k3d-tools and k3d-proxy * remove ref event triggerpull/287/head
parent
3cd1a05b91
commit
4272ad4fd8
@ -0,0 +1,184 @@ |
|||||||
|
--- |
||||||
|
kind: pipeline |
||||||
|
type: docker |
||||||
|
name: main |
||||||
|
|
||||||
|
platform: |
||||||
|
os: linux |
||||||
|
arch: amd64 |
||||||
|
|
||||||
|
steps: |
||||||
|
|
||||||
|
- name: lint |
||||||
|
image: golang:1.14 |
||||||
|
commands: |
||||||
|
- make ci-setup |
||||||
|
- make check-fmt lint |
||||||
|
when: |
||||||
|
event: |
||||||
|
- push |
||||||
|
- pull_request |
||||||
|
- tag |
||||||
|
|
||||||
|
- name: test |
||||||
|
image: docker:19.03 |
||||||
|
volumes: |
||||||
|
- name: dockersock |
||||||
|
path: /var/run |
||||||
|
commands: |
||||||
|
- apk add git bash curl sudo jq make |
||||||
|
- sleep 5 # give docker enough time to start |
||||||
|
- make e2e |
||||||
|
when: |
||||||
|
event: |
||||||
|
- push |
||||||
|
- pull_request |
||||||
|
- tag |
||||||
|
|
||||||
|
- name: build |
||||||
|
image: golang:1.14 |
||||||
|
commands: |
||||||
|
- make ci-setup |
||||||
|
- make build-cross |
||||||
|
depends_on: |
||||||
|
- lint |
||||||
|
- test |
||||||
|
when: |
||||||
|
branch: |
||||||
|
- master |
||||||
|
event: |
||||||
|
- push |
||||||
|
- tag |
||||||
|
|
||||||
|
- name: release |
||||||
|
image: plugins/github-release |
||||||
|
settings: |
||||||
|
api_key: |
||||||
|
from_secret: github_token |
||||||
|
files: |
||||||
|
- _dist/* |
||||||
|
checksum: |
||||||
|
- sha256 |
||||||
|
depends_on: |
||||||
|
- lint |
||||||
|
- test |
||||||
|
- build |
||||||
|
when: |
||||||
|
event: |
||||||
|
- tag |
||||||
|
|
||||||
|
services: |
||||||
|
# Starting the docker service to be used by dind |
||||||
|
- name: docker |
||||||
|
image: docker:19.03-dind |
||||||
|
privileged: true |
||||||
|
volumes: |
||||||
|
- name: dockersock |
||||||
|
path: /var/run |
||||||
|
|
||||||
|
volumes: |
||||||
|
- name: dockersock |
||||||
|
temp: {} |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
kind: pipeline |
||||||
|
type: docker |
||||||
|
name: docs |
||||||
|
|
||||||
|
platform: |
||||||
|
os: linux |
||||||
|
arch: amd64 |
||||||
|
|
||||||
|
steps: |
||||||
|
|
||||||
|
- name: build |
||||||
|
image: python:3.8 |
||||||
|
commands: |
||||||
|
- python3 -m pip install -r docs/requirements.txt |
||||||
|
- mkdocs build --verbose --clean --strict |
||||||
|
when: |
||||||
|
branch: |
||||||
|
- master |
||||||
|
event: |
||||||
|
- push |
||||||
|
|
||||||
|
- name: publish |
||||||
|
image: plugins/gh-pages |
||||||
|
settings: |
||||||
|
password: |
||||||
|
from_secret: github_token |
||||||
|
username: |
||||||
|
from_secret: github_username |
||||||
|
pages_directory: site/ |
||||||
|
target_branch: gh-pages |
||||||
|
when: |
||||||
|
branch: |
||||||
|
- master |
||||||
|
event: |
||||||
|
- push |
||||||
|
|
||||||
|
trigger: |
||||||
|
event: |
||||||
|
- push |
||||||
|
ref: |
||||||
|
- master |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
kind: pipeline |
||||||
|
type: docker |
||||||
|
name: proxy |
||||||
|
|
||||||
|
platform: |
||||||
|
os: linux |
||||||
|
arch: amd64 |
||||||
|
|
||||||
|
steps: |
||||||
|
# TODO: use tag from git (without 'proxy-' prefix) |
||||||
|
- name: build_push |
||||||
|
image: plugins/docker |
||||||
|
settings: |
||||||
|
repo: rancher/k3d-proxy |
||||||
|
dockerfile: proxy/Dockerfile |
||||||
|
context: proxy/ |
||||||
|
username: |
||||||
|
from_secret: dockerhub_username |
||||||
|
password: |
||||||
|
from_secret: dockerhub_password |
||||||
|
when: |
||||||
|
event: |
||||||
|
- tag |
||||||
|
|
||||||
|
trigger: |
||||||
|
event: |
||||||
|
- tag |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
kind: pipeline |
||||||
|
type: docker |
||||||
|
name: tools |
||||||
|
|
||||||
|
platform: |
||||||
|
os: linux |
||||||
|
arch: amd64 |
||||||
|
|
||||||
|
steps: |
||||||
|
- name: build_push |
||||||
|
image: plugins/docker |
||||||
|
settings: |
||||||
|
repo: rancher/k3d-tools |
||||||
|
dockerfile: tools/Dockerfile |
||||||
|
context: tools/ |
||||||
|
username: |
||||||
|
from_secret: dockerhub_username |
||||||
|
password: |
||||||
|
from_secret: dockerhub_password |
||||||
|
when: |
||||||
|
event: |
||||||
|
- tag |
||||||
|
|
||||||
|
trigger: |
||||||
|
event: |
||||||
|
- tag |
@ -1,47 +0,0 @@ |
|||||||
matrix: |
|
||||||
include: |
|
||||||
- dist: bionic |
|
||||||
language: go |
|
||||||
env: |
|
||||||
- GO111MODULE=on |
|
||||||
go: |
|
||||||
- 1.14.x |
|
||||||
git: |
|
||||||
depth: 1 |
|
||||||
install: true |
|
||||||
before_script: |
|
||||||
- make ci-setup |
|
||||||
script: |
|
||||||
- make -e "E2E_SKIP=test_multi_master" ci-tests build-cross |
|
||||||
deploy: |
|
||||||
provider: releases |
|
||||||
skip_cleanup: true |
|
||||||
api_key: |
|
||||||
secure: VFb0jmL6t+cuKWAGC5OLeseTJrK3CakD5Laeyp0JVG/o3/cYgHP0lIeDmJJMZL/Luxm5aL8QHsCRfQoMBAnj6Q8hchI9rbcYhFZzuFJYyDxjcrPm0+kM3yiK14lQZNvksy2ZSsO7D63c8x9sQVrEus4idVTUoxrpSXLM2eVjl6W0O2RdZvLsxgaLPwV1ufpihrqbXdEUjt/YSYpHiC5gS3o+FcyMGucJQdN/L7p6jyAqVgg4+t8bdyWj6+MEG4p8lmWhhbGzDo38iMxtCBu+nDHRsbivay3eJZ643VguX0lj62Vt5KUTcVJntmZqQ2UF6FoEVUPOegkrSeoiMuOH1+nYwcsfMFijMkrcFhb6bAisJJd6agdhFWXiSwL88FQkJh0DqeA0tFFIzDbTS/AZTY4Li8bWng3aCBgSXiMzIBf0es+wMDw0gwhfH44Y/RAsKSQJ/Lln00AaVzkOkOWOmu5Ks0CVYDy0M5QDQOCW2E9TIb7WdIMh3aNCkZi+rGovigejJv3vUZqkN03Og07Hbrjgfg28iY3isIt3soOrVqek2hJJFnKjUhhv2OhJm3z6FpTyMViUtSmJ+LTiBjpyiWC4QuaITDadCJTxZQwobhI+18c2Zi5/HjTX1pgD1wk3quv9R4bGjVINenefG6xxaNj+CeFTfrQnnHuXOL50828= |
|
||||||
file: |
|
||||||
- _dist/k3d-darwin-amd64 |
|
||||||
- _dist/k3d-linux-386 |
|
||||||
- _dist/k3d-linux-amd64 |
|
||||||
- _dist/k3d-linux-arm |
|
||||||
- _dist/k3d-linux-arm64 |
|
||||||
- _dist/k3d-windows-amd64.exe |
|
||||||
on: |
|
||||||
repo: rancher/k3d |
|
||||||
tags: true |
|
||||||
- dist: bionic |
|
||||||
language: python |
|
||||||
python: 3.8 |
|
||||||
before_script: |
|
||||||
- python3 -m pip install -r docs/requirements.txt |
|
||||||
script: |
|
||||||
- mkdocs build --verbose --clean --strict |
|
||||||
deploy: |
|
||||||
provider: pages |
|
||||||
skip_cleanup: true |
|
||||||
github_token: |
|
||||||
secure: VFb0jmL6t+cuKWAGC5OLeseTJrK3CakD5Laeyp0JVG/o3/cYgHP0lIeDmJJMZL/Luxm5aL8QHsCRfQoMBAnj6Q8hchI9rbcYhFZzuFJYyDxjcrPm0+kM3yiK14lQZNvksy2ZSsO7D63c8x9sQVrEus4idVTUoxrpSXLM2eVjl6W0O2RdZvLsxgaLPwV1ufpihrqbXdEUjt/YSYpHiC5gS3o+FcyMGucJQdN/L7p6jyAqVgg4+t8bdyWj6+MEG4p8lmWhhbGzDo38iMxtCBu+nDHRsbivay3eJZ643VguX0lj62Vt5KUTcVJntmZqQ2UF6FoEVUPOegkrSeoiMuOH1+nYwcsfMFijMkrcFhb6bAisJJd6agdhFWXiSwL88FQkJh0DqeA0tFFIzDbTS/AZTY4Li8bWng3aCBgSXiMzIBf0es+wMDw0gwhfH44Y/RAsKSQJ/Lln00AaVzkOkOWOmu5Ks0CVYDy0M5QDQOCW2E9TIb7WdIMh3aNCkZi+rGovigejJv3vUZqkN03Og07Hbrjgfg28iY3isIt3soOrVqek2hJJFnKjUhhv2OhJm3z6FpTyMViUtSmJ+LTiBjpyiWC4QuaITDadCJTxZQwobhI+18c2Zi5/HjTX1pgD1wk3quv9R4bGjVINenefG6xxaNj+CeFTfrQnnHuXOL50828= |
|
||||||
local_dir: site |
|
||||||
on: |
|
||||||
repo: rancher/k3d |
|
||||||
branch: master |
|
||||||
|
|
Loading…
Reference in new issue