Little helper to run CNCF's k3s in Docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
k3d/.drone.yml

431 lines
9.3 KiB

---
###########################################
##### k3d CLI/binary release pipeline #####
###########################################
kind: pipeline
type: docker
name: main
platform:
os: linux
arch: amd64
steps:
- name: lint
image: golang:1.17
commands:
- make ci-setup
- make check-fmt lint
when:
event:
- push
- pull_request
- tag
- name: test
image: docker:20.10
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.17
environment:
GIT_TAG: "${DRONE_TAG}"
commands:
- make ci-setup
- make build-cross
depends_on:
- lint
- test
when:
event:
- push
- tag
- name: pre-release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- _dist/*
checksum:
- sha256
prerelease: true
depends_on:
- lint
- test
- build
when:
event:
- tag
ref:
include:
# include only pre-release tags
- "refs/tags/*rc*"
- "refs/tags/*beta*"
- "refs/tags/*alpha*"
- "refs/tags/*test*"
- "refs/tags/*dev*"
- 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
ref:
exclude:
# exclude pre-release tags
- "refs/tags/*rc*"
- "refs/tags/*beta*"
- "refs/tags/*alpha*"
- "refs/tags/*test*"
- "refs/tags/*dev*"
services:
# Starting the docker service to be used by dind
- name: docker
image: docker:20.10-dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
---
###########################
###### Docker Images ######
###########################
#
# +++ Docker Images +++
# Tagged using the auto_tag feature of the docker plugin
# See http://plugins.drone.io/drone-plugins/drone-docker/#autotag
# > if event type is `tag`
# > > 1.0.0 produces docker tags 1, 1.0, 1.0.0
# > > 1.0.0-rc.1 produces docker tags 1.0.0-rc.1
# > if event type is `push` and target branch == default branch (main)
# > > tag `latest`
################################
##### Docker Images: amd64 #####
################################
kind: pipeline
type: docker
name: linux_amd64
platform:
os: linux
arch: amd64
steps:
- name: build_push_binary
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
settings:
repo: rancher/k3d
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: Dockerfile
target: binary-only
context: .
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- GIT_TAG_OVERRIDE=${DRONE_TAG}
- name: build_push_dind
image: plugins/docker
environment:
DOCKER_BUILDKIT: "1"
settings:
repo: rancher/k3d
auto_tag: true
auto_tag_suffix: dind-linux-amd64
dockerfile: Dockerfile
target: dind
context: .
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- GIT_TAG_OVERRIDE=${DRONE_TAG}
- ARCH=amd64
- name: build_push_proxy
image: plugins/docker
settings:
repo: rancher/k3d-proxy
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: proxy/Dockerfile
context: proxy/
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: build_push_tools
image: plugins/docker
settings:
repo: rancher/k3d-tools
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: tools/Dockerfile
context: tools/
username:
from_secret: docker_username
password:
from_secret: docker_password
trigger:
event:
- tag # see note at the start of the "Docker Images" section: creates SemVer tagged images using the `auto_tag` option of the docker plugin
- push # `auto_tag` option only creates the `latest` tag if target branch is default branch (i.e. `main`)
depends_on:
- main
---
################################
##### Docker Images: arm #####
################################
kind: pipeline
type: docker
name: linux_arm
platform:
os: linux
arch: arm
steps:
- name: build_push_proxy
image: plugins/docker
settings:
repo: rancher/k3d-proxy
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: proxy/Dockerfile
context: proxy/
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- ARCH=arm
- name: build_push_tools
image: plugins/docker
settings:
repo: rancher/k3d-tools
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: tools/Dockerfile
context: tools/
username:
from_secret: docker_username
password:
from_secret: docker_password
trigger:
event:
- tag # see note at the start of the "Docker Images" section: creates SemVer tagged images using the `auto_tag` option of the docker plugin
- push # `auto_tag` option only creates the `latest` tag if target branch is default branch (i.e. `main`)
depends_on:
- main
---
################################
##### Docker Images: arm64 #####
################################
kind: pipeline
type: docker
name: linux_arm64
platform:
os: linux
arch: arm64
steps:
- name: build_push_binary
environment:
DOCKER_BUILDKIT: "1"
image: plugins/docker
settings:
repo: rancher/k3d
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: Dockerfile
target: binary-only
context: .
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- GIT_TAG_OVERRIDE=${DRONE_TAG}
- name: build_push_dind
image: plugins/docker
environment:
DOCKER_BUILDKIT: "1"
settings:
repo: rancher/k3d
auto_tag: true
auto_tag_suffix: dind-linux-arm64
dockerfile: Dockerfile
target: dind
context: .
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- GIT_TAG_OVERRIDE=${DRONE_TAG}
- ARCH=arm64
- name: build_push_proxy
image: plugins/docker
settings:
repo: rancher/k3d-proxy
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: proxy/Dockerfile
context: proxy/
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- ARCH=arm64
- name: build_push_tools
image: plugins/docker
settings:
repo: rancher/k3d-tools
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: tools/Dockerfile
context: tools/
username:
from_secret: docker_username
password:
from_secret: docker_password
trigger:
event:
- tag # see note at the start of the "Docker Images" section: creates SemVer tagged images using the `auto_tag` option of the docker plugin
- push # `auto_tag` option only creates the `latest` tag if target branch is default branch (i.e. `main`)
depends_on:
- main
---
##############################
###### Docker Manifests ######
##############################
kind: pipeline
type: docker
name: manifests
platform:
os: linux
arch: amd64
steps:
- name: push_manifest_binary
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: manifest.tmpl
auto_tag: true
ignore_missing: true # expected, as we dropped arm due to missing base image for that arch
- name: push_manifest_dind
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: dind-manifest.tmpl
auto_tag: true
ignore_missing: true # expected, as we dropped arm due to missing base image for that arch
- name: push_manifest_proxy
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: proxy/manifest.tmpl
auto_tag: true
ignore_missing: false
- name: push_manifest_tools
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: tools/manifest.tmpl
auto_tag: true
ignore_missing: false
trigger:
event:
- tag # see note at the start of the "Docker Images" section: creates SemVer tagged images using the `auto_tag` option of the manifest plugin
- push # `auto_tag` option only creates the `latest` tag if target branch is default branch (i.e. `main`)
depends_on:
- main
- linux_amd64
- linux_arm
- linux_arm64