Skip to content

Commit

Permalink
[Enhancement] Github Actions: new Release job (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwilltry42 authored Mar 24, 2022
1 parent db02916 commit f2df55a
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 131 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,16 @@ jobs:
id: semver
with:
version: ${{ steps.tag.outputs.VERSION }}
- name: Git Release
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: anton-yurchenko/git-release@v4
env:
PRE_RELEASE: "${{ steps.semver.outputs.prerelease }}"
ALLOW_EMPTY_CHANGELOG: "false"
uses: ncipollo/release-action@v1
with:
args: _dist/*
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: _dist/*
discussionCategory: releases
generateReleaseNotes: true
prerelease: ${{ steps.semver.outputs.prerelease != '' }}
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ build-docker-%:
build-helper-images: build-proxy-image build-tools-image

build-proxy-image:
@echo "Building docker image rancher/k3d-proxy:$(K3D_IMAGE_TAG)"
DOCKER_BUILDKIT=1 docker build --quiet --no-cache proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(K3D_IMAGE_TAG)
@echo "Building docker image ghcr.io/k3d-io/k3d-proxy:$(K3D_IMAGE_TAG)"
DOCKER_BUILDKIT=1 docker build --quiet --no-cache proxy/ -f proxy/Dockerfile -t ghcr.io/k3d-io/k3d-proxy:$(K3D_IMAGE_TAG)

build-tools-image:
@echo "Building docker image rancher/k3d-tools:$(K3D_IMAGE_TAG)"
DOCKER_BUILDKIT=1 docker build --quiet --no-cache tools/ -f tools/Dockerfile -t rancher/k3d-tools:$(K3D_IMAGE_TAG) --build-arg GIT_TAG=$(GIT_TAG)
@echo "Building docker image ghcr.io/k3d-io/k3d-tools:$(K3D_IMAGE_TAG)"
DOCKER_BUILDKIT=1 docker build --quiet --no-cache tools/ -f tools/Dockerfile -t ghcr.io/k3d-io/k3d-tools:$(K3D_IMAGE_TAG) --build-arg GIT_TAG=$(GIT_TAG)

##############################
########## Cleaning ##########
Expand Down
27 changes: 0 additions & 27 deletions dind-manifest.tmpl

This file was deleted.

12 changes: 4 additions & 8 deletions docs/design/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ On this page we'll try to give an overview of all the moving bits and pieces in
- all function calls within [`cmd/`](https://github.com/k3d-io/k3d/tree/main/cmd) that do non-trivial things are imported from here
- this (or rather sub-packages) is what other projects would import as a module to work with k3d without using the CLI
- [`proxy/`](https://github.com/k3d-io/k3d/tree/main/proxy)
- configuration to build the [`rancher/k3d-proxy`](https://hub.docker.com/r/rancher/k3d-proxy/) container image which is used as a loadbalancer/proxy in front of (almost) every k3d cluster
- configuration to build the [`k3d-io/k3d-proxy`](https://github.com/k3d-io/k3d/pkgs/container/k3d-proxy) container image which is used as a loadbalancer/proxy in front of (almost) every k3d cluster
- this is basically just a combination of NGINX with confd and some k3d-specific configuration details
- [`tests/`](https://github.com/k3d-io/k3d/tree/main/tests)
- a set of bash scripts used for end-to-end (E2E) tests of k3d
- mostly used for all the functionality of the k3d CLI which cannot be tested using Go unit tests
- [`tools/`](https://github.com/k3d-io/k3d/tree/main/tools)
- sub-module used to build the [`rancher/k3d-tools`](https://hub.docker.com/r/rancher/k3d-tools) container image which supports some k3d functionality like `k3d image import`
- sub-module used to build the [`k3d-io/k3d-tools`](https://github.com/k3d-io/k3d/pkgs/container/k3d-tools) container image which supports some k3d functionality like `k3d image import`
- [`vendor/`](https://github.com/k3d-io/k3d/tree/main/vendor)
- result of `go mod vendor`, which contains all dependencies of k3d
- [`version/`](https://github.com/k3d-io/k3d/tree/main/version)
Expand All @@ -49,7 +49,7 @@ On this page we'll try to give an overview of all the moving bits and pieces in
- interface and implementations of runtimes that power k3d (currently, that's only Docker)
- functions in [`client/`](https://github.com/k3d-io/k3d/tree/main/pkg/client) eventually call runtime functions to "materialize" nodes and clusters
- [`tools/`](https://github.com/k3d-io/k3d/tree/main/pkg/tools)
- functions eventually calling the [`k3d-tools`](https://hub.docker.com/r/rancher/k3d-tools) container (see [`tools/`](https://github.com/k3d-io/k3d/tree/main/tools) in the repo root)
- functions eventually calling the [`k3d-tools`](https://github.com/k3d-io/k3d/pkgs/container/k3d-tools) container (see [`tools/`](https://github.com/k3d-io/k3d/tree/main/tools) in the repo root)
- [`types/`](https://github.com/k3d-io/k3d/tree/main/pkg/types)
- definition of all k3d primitives and many other details and defaults
- e.g. contains the definition of a `Node` or a `Cluster` in k3d
Expand All @@ -62,7 +62,7 @@ By default, every k3d cluster consists of at least 2 containers (nodes):

1. (optional, but default and strongly recommended) loadbalancer

- image: [`rancher/k3d-proxy`](https://hub.docker.com/r/rancher/k3d-proxy/), built from [`proxy/`](https://github.com/k3d-io/k3d/tree/main/proxy)
- image: [`ghcr.io/k3d-io/k3d-proxy`](https://github.com/k3d-io/k3d/pkgs/container/k3d-proxy), built from [`proxy/`](https://github.com/k3d-io/k3d/tree/main/proxy)
- purpose: proxy and load balance requests from the outside (i.e. most of the times your local host) to the cluster
- by default, it e.g. proxies all the traffic for the Kubernetes API to port `6443` (default listening port of K3s) to all the server nodes in the cluster
- can be used for multiple port-mappings to one or more nodes in your cluster
Expand Down Expand Up @@ -91,16 +91,12 @@ The k3d repository mainly leverages the following two CI systems:
- GitHub Actions
- 2 workflows in <https://github.com/k3d-io/k3d/tree/main/.github/workflows> to push the artifact to AUR (Arch Linux User Repository)
- logs/history can be seen in the Actions tab: <https://github.com/k3d-io/k3d/actions>
- DroneCI
- a set of pipelines in a single file: <https://github.com/k3d-io/k3d/blob/main/.drone.yml>
- static code analysis
- build
- tests
- docker builds + pushes
- render + push docs
- (pre-) release to GitHub
- `push` events end up here (also does the releases, when a tag is pushed): <https://drone-publish.rancher.io/rancher/k3d>
- `pr`s end up here: <https://drone-pr.rancher.io/rancher/k3d>

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/advanced/podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Podman has an [Docker API compatibility layer](https://podman.io/blogs/2020/06/29/podman-v2-announce.html#restful-api). k3d uses the Docker API and is compatible with Podman v4 and higher.

!!! important "Podman support is experimental"
k3d is not guaranteed to work with Podman. If you find a bug, do help by [filing an issue](https://github.com/rancher/k3d/issues/new?labels=bug&template=bug_report.md&title=%5BBUG%5D+Podman)
k3d is not guaranteed to work with Podman. If you find a bug, do help by [filing an issue](https://github.com/k3d-io/k3d/issues/new?labels=bug&template=bug_report.md&title=%5BBUG%5D+Podman)

## Using Podman

Expand Down
27 changes: 0 additions & 27 deletions manifest.tmpl

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/types/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
const DefaultK3sImageRepo = "docker.io/rancher/k3s"

// DefaultLBImageRepo defines the default cluster load balancer image
const DefaultLBImageRepo = "docker.io/rancher/k3d-proxy"
const DefaultLBImageRepo = "ghcr.io/k3d-io/k3d-proxy"

// DefaultToolsImageRepo defines the default image used for the tools container
const DefaultToolsImageRepo = "docker.io/rancher/k3d-tools"
const DefaultToolsImageRepo = "ghcr.io/k3d-io/k3d-tools"

// DefaultRegistryImageRepo defines the default image used for the k3d-managed registry
const DefaultRegistryImageRepo = "docker.io/library/registry"
Expand Down
4 changes: 2 additions & 2 deletions proxy/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: test

test:
docker build . -t rancher/k3d-proxy:dev --no-cache
docker run --rm -v $(shell pwd)/test/portmap.yaml:/etc/confd/values.yaml rancher/k3d-proxy:dev
docker build . -t ghcr.io/k3d-io/k3d-proxy:dev --no-cache
docker run --rm -v $(shell pwd)/test/portmap.yaml:/etc/confd/values.yaml ghcr.io/k3d-io/k3d-proxy:dev
27 changes: 0 additions & 27 deletions proxy/manifest.tmpl

This file was deleted.

27 changes: 0 additions & 27 deletions tools/manifest.tmpl

This file was deleted.

0 comments on commit f2df55a

Please sign in to comment.