Skip to content

Commit

Permalink
Remove dapper, greatly simplify package system (#69)
Browse files Browse the repository at this point in the history
* Remove dapper, greatly simplify package system

Signed-off-by: Derek Nola <[email protected]>

* Update README per CNCF guidelines

Signed-off-by: Derek Nola <[email protected]>

* Remove unnecessary package folder

Signed-off-by: Derek Nola <[email protected]>

* Pass arch from drone

Signed-off-by: Derek Nola <[email protected]>

---------

Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola authored Jun 3, 2024
1 parent 69ae192 commit bb2bb34
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 106 deletions.
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

24 changes: 17 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.5.0
image: docker:25.0-git
environment:
ARCH: "${DRONE_STAGE_ARCH}"
commands:
- dapper ci
- apk add make
- git config --global --add safe.directory /drone/src
- make
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down Expand Up @@ -51,9 +55,13 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.5.0
image: docker:25.0-git
environment:
ARCH: "${DRONE_STAGE_ARCH}"
commands:
- dapper ci
- apk add make
- git config --global --add safe.directory /drone/src
- make
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down Expand Up @@ -93,11 +101,13 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.5.0
image: docker:25.0-git
environment:
DAPPER_HOST_ARCH: arm
ARCH: "${DRONE_STAGE_ARCH}"
commands:
- dapper ci
- apk add make
- git config --global --add safe.directory /drone/src
- make
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/.dapper
/.cache
/.trash-cache
/bin
/dist
*.swp
File renamed without changes.
19 changes: 0 additions & 19 deletions Dockerfile.dapper

This file was deleted.

26 changes: 4 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
TARGETS := $(shell ls scripts)

.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper

$(TARGETS): .dapper
./.dapper $@

trash: .dapper
./.dapper -m bind trash

trash-keep: .dapper
./.dapper -m bind trash -k

deps: trash

.DEFAULT_GOAL := ci

.PHONY: $(TARGETS)
.PHONY: ci
ci:
@. ./scripts/version; docker build --build-arg BUILDDATE=$(date +%Y%m%d) -f Dockerfile -t $${IMAGE} .
@. ./scripts/version; echo Built $${IMAGE}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Klipper Service Load Balancer
=================

_NOTE: this repository has been recently (2020-11-18) moved out of the github.com/rancher org to github.com/k3s-io
_NOTE: this repository was moved 2020-11-18 out of the github.com/rancher org to github.com/k3s-io
supporting the [acceptance of K3s as a CNCF sandbox project](https://github.com/cncf/toc/pull/447)_.

---
Expand All @@ -17,7 +17,7 @@ will stay in pending.
`make`

## License
Copyright (c) 2019 [Rancher Labs, Inc.](http://rancher.com)
Copyright (c) 2024 [K3s Authors](http://github.com/k3s-io)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 0 additions & 6 deletions scripts/ci

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/entry

This file was deleted.

25 changes: 0 additions & 25 deletions scripts/package

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/release

This file was deleted.

16 changes: 12 additions & 4 deletions scripts/version
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
Expand All @@ -7,12 +7,20 @@ fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)}

if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
if [ -z "$DIRTY" ] && [ -n "$GIT_TAG" ]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi

if [ -z "$ARCH" ]; then
ARCH=$(go env GOHOSTARCH)
ARCH=${ARCH:-"amd64"}
TAG=${TAG:-${VERSION}-${ARCH}}
REPO=${REPO:-rancher}

if echo $TAG | grep -q dirty; then
TAG=dev
fi

IMAGE=${REPO}/klipper-lb:${TAG}


0 comments on commit bb2bb34

Please sign in to comment.