Skip to content

Commit 85b515f

Browse files
committed
add kerw and berw release
1 parent 6920e96 commit 85b515f

File tree

6 files changed

+120
-100
lines changed

6 files changed

+120
-100
lines changed

Makefile

Lines changed: 0 additions & 72 deletions
This file was deleted.

go-client/Makefile

Lines changed: 63 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,94 @@
11
SHELL:=/bin/bash
2-
export VERSION=0.1
2+
export VERSION=0.2
33

44
.PHONY: all
55
all: build
66

7-
.DEFAULT_GOAL := all
7+
.DEFAULT_GOAL := help
88

99
current_dir = $(shell pwd)
1010

11+
#help: @ List available tasks on this project
12+
help:
13+
@grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
14+
15+
#build: @ Build binaris with go
1116
build:
12-
rm -rf dist
17+
rm -rf dist/{windows,linux,osx,release}
1318
go build -o dist/linux/kubectl-login main.go
1419
env GOOS=darwin GOARCH=amd64 go build -o dist/osx/kubectl-login main.go
1520
env GOOS=windows GOARCH=amd64 go build -o dist/windows/kubectl-login.exe main.go
16-
# docker run -v $(pwd):/src -w /src -it --rm linuturk/mono-choco new kubectl-login
1721

22+
#package: @ Create archives, brew and choco files
1823
package:
19-
# mkdir -p dist/release
20-
# cd dist/linux; \
24+
@echo "🎁 Packaging"
25+
mkdir -p dist/release
26+
27+
cd dist/linux; \
2128
chmod +x kubectl-login; \
22-
tar -czf kubectl-login_linux.tar.gz kubectl-login
23-
# CHECKSUM=$$(sha256sum dist/linux/kubectl-login_linux.tar.gz | cut -d ' ' -f1); \
29+
tar -czf kubectl-login_linux.tar.gz kubectl-login; \
30+
sha256sum dist/linux/kubectl-login_linux.tar.gz > dist/linux/kubectl-login_linux.tar.gz.sha256
31+
32+
CHECKSUM=$$(sha256sum dist/linux/kubectl-login_linux.tar.gz | cut -d ' ' -f1); \
2433
sed -i "s/#checksum_linux#/$$CHECKSUM/" dist/homebrew/kubectl-login.rb; \
25-
sed -i "s/#version#/${VERSION}/" dist/homebrew/kubectl-login.rb
34+
sed -i "s/#version#/${VERSION}/" dist/homebrew/kubectl-login.rb; \
35+
sed -i "s/#checksum_linux#/$$CHECKSUM/" dist/krew/openid-connect.yaml; \
36+
sed -i "s/#version#/${VERSION}/" dist/krew/openid-connect.yaml;
2637

27-
# cd dist/osx; \
38+
cd dist/osx; \
2839
chmod +x kubectl-login; \
29-
tar -czf kubectl-login_osx.tar.gz kubectl-login
30-
# CHECKSUM=$$(sha256sum dist/osx/kubectl-login_osx.tar.gz | cut -d ' ' -f1); \
31-
# sed -i "s/#checksum_osx#/$$CHECKSUM/" dist/homebrew/kubectl-login.rb
40+
tar -czf kubectl-login_osx.tar.gz kubectl-login; \
41+
sha256sum dist/linux/kubectl-login_osx.tar.gz > dist/linux/kubectl-login_osx.tar.gz.sha256
3242

33-
# cd dist/windows; \
34-
zip kubectl-login_windows.zip kubectl-login.exe
43+
CHECKSUM=$$(sha256sum dist/osx/kubectl-login_osx.tar.gz | cut -d ' ' -f1); \
44+
sed -i "s/#checksum_osx#/$$CHECKSUM/" dist/homebrew/kubectl-login.rb; \
45+
sed -i "s/#checksum_osx#/$$CHECKSUM/" dist/krew/openid-connect.yaml
46+
47+
cd dist/windows; \
48+
zip kubectl-login_windows.zip kubectl-login.exe; \
49+
sha256sum dist/linux/kubectl-login_windows.zip > dist/linux/kubectl-login_windows.zip.sha256
3550

3651
CHECKSUM=$$(sha256sum dist/windows/kubectl-login_windows.zip | cut -d ' ' -f1); \
52+
ed -i "s/#checksum_windows#/$$CHECKSUM/" dist/krew/openid-connect.yaml; \
3753
sed -i "s/#checksum#/$$CHECKSUM/" dist/choco/tools/VERIFICATION.txt; \
3854
sed -i "s/#version#/${VERSION}/" dist/choco/tools/VERIFICATION.txt; \
3955
sed -i "s/#version#/${VERSION}/" dist/choco/kubectl-login.nuspec
4056
cp dist/windows/kubectl-login_windows.zip dist/choco/tools/
4157
docker run -v `pwd`/dist/choco/:/src -w /src -it --rm linuturk/mono-choco pack
4258
rm -f dist/choco/tools/kubectl-login_windows.zip
4359

60+
#release: @ Create release on github and publish choco package
4461
release:
45-
# mv dist/windows/kubectl-login_windows.zip dist/release/
46-
# mv dist/linux/kubectl-login_linux.tar.gz dist/release/
47-
# mv dist/osx/kubectl-login_osx.tar.gz dist/release/
48-
# mv dist/choco/kubectl-login*.nupkg dist/release/
49-
# gh release create client_v${VERSION} --generate-notes ./dist/release/*
50-
docker run -v `pwd`/dist/choco/:/src -w /src -it --rm linuturk/mono-choco push kubectl-login.${VERSION}.nupkg --key ${CHOCO_TOKEN} --source https://push.chocolatey.org/
62+
@echo "🤖 CD bot is DReleasing
63+
64+
mv dist/windows/kubectl-login_windows.zip* dist/release/
65+
mv dist/linux/kubectl-login_linux.tar.gz* dist/release/
66+
mv dist/osx/kubectl-login_osx.tar.gz* dist/release/
67+
mv dist/choco/kubectl-login*.nupkg dist/release/
68+
gh release create client_v${VERSION} --generate-notes ./dist/release/*
69+
70+
# docker run -v `pwd`/dist/choco/:/src -w /src -it --rm linuturk/mono-choco push kubectl-login.${VERSION}.nupkg --key ${CHOCO_TOKEN} --source https://push.chocolatey.org/
71+
72+
git clone [email protected]:devopstales/homebrew-devopstales.git; \
73+
cd homebrew-devopstales; \
74+
git config user.name "devopstales"; \
75+
git config user.email "[email protected]"; \
76+
rm -f kubectl-login.rb; \
77+
cp ../dist/homebrew/kubectl-login.rb .; \
78+
git add kubectl-login.rb && git commit -m "release ${VERSION}"; \
79+
git push
80+
81+
git clone [email protected]:devopstales/krew-index.git; \
82+
cd krew-index/plugins; \
83+
git config user.name "devopstales"; \
84+
git config user.email "[email protected]"; \
85+
rm -f openid-connect.yaml; \
86+
cp ../../dist/krew/openid-connect.yaml; \
87+
git add openid-connect.yaml && git commit -m "release ${VERSION}"; \
88+
git push
89+
5190
# rm -rf dist/{windows,linux,osx,release}
91+
# rm -rf homebrew-devopstales
92+
# rm -rf krew-index
93+
@echo "🚀 Packages are deployed!"
5294

go-client/dist/homebrew/kubectl-login.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ class KubectlLogin < Formula
22
desc "An application that can be used to easily enable authentication flows via OIDC for a kubernetes cluster. "
33
homepage "https://github.com/devopstales/kube-openid-connect/"
44
license "Apache-2.0"
5-
version "0.1"
5+
version "#version#"
66

77
if OS.mac?
8-
url "https://github.com/devopstales/kube-openid-connect/releases/download/client_v0.1/kubectl-login_osx.tar.gz"
9-
sha256 "bed8b7bf796129943adabcda66fd3574e508a384040074a1be3561a70f32cd81"
8+
url "https://github.com/devopstales/kube-openid-connect/releases/download/client_v#version#/kubectl-login_osx.tar.gz"
9+
sha256 "#checksum_osx#"
1010
elsif OS.linux?
11-
url "https://github.com/devopstales/kube-openid-connect/releases/download/client_v0.1/kubectl-login_linux.tar.gz"
12-
sha256 "f57602e427507b91b2b4a25fc5786c7514d3ea3243bd191f9feae6d79d69a9c7"
11+
url "https://github.com/devopstales/kube-openid-connect/releases/download/client_v#version#/kubectl-login_linux.tar.gz"
12+
sha256 "#checksum_linux#"
1313
end
1414

1515
def install
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: krew.googlecontainertools.github.com/v1alpha2
2+
kind: Plugin
3+
metadata:
4+
name: openid-connect
5+
spec:
6+
version: "#version#"
7+
homepage: https://github.com/devopstales/kube-openid-connect
8+
shortDescription: Login to a cluster via openid-connect
9+
description: |
10+
Launches a browser to login to the cluster via openid-connect. openid-connect's
11+
certificate MUST be trusted by the local system.
12+
13+
Run `kubectl login <openid-connect-ingress-url>`.
14+
It automatically opens the browser and you can log in to the provider.
15+
After authentication, it writes the token to the kubeconfig and you can access the cluster.
16+
caveats: |
17+
1) You need to install the openid-connect server component by helm:
18+
2) You need to setup the OIDC provider at Kubernetes API server.
19+
3) You need to setup role binding for users or groupe.
20+
platforms:
21+
- bin: kubectl-login
22+
uri: https://github.com/devopstales/kube-openid-connect/releases/download/client_v#version#/kubectl-login_linux.tar.gz
23+
sha256: #checksum_linux#
24+
selector:
25+
matchLabels:
26+
os: linux
27+
arch: amd64
28+
- bin: kubectl-login
29+
uri: https://github.com/devopstales/kube-openid-connect/releases/download/client_v#version#/kubectl-login_osx.tar.gz
30+
sha256: #checksum_osx#
31+
selector:
32+
matchLabels:
33+
os: darwin
34+
arch: arm64
35+
- bin: kubectl-login.exe
36+
uri: https://github.com/devopstales/kube-openid-connect/releases/download/client_v#version#/kubectl-login_windows.zip
37+
sha256: #checksum_windows#
38+
selector:
39+
matchLabels:
40+
os: windows
41+
arch: amd64

py-client/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ export RELEASE=v0.1
44
.PHONY: all
55
all: build
66

7-
.DEFAULT_GOAL := all
7+
.DEFAULT_GOAL := help
88

99
current_dir = $(shell pwd)
1010

11+
#help: @ List available tasks on this project
12+
help:
13+
@grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
14+
1115
build:
1216
cp kubectl-login.py pyinstaller/kubectl-login.py
1317
cp requirements.txt pyinstaller/requirements.txt

server/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ export RELEASE=v0.1
55
all: version
66
dev: devel-delete devel
77

8-
.DEFAULT_GOAL := all
8+
.DEFAULT_GOAL := help
99

1010
current_dir = $(shell pwd)
1111

12+
#help: @ List available tasks on this project
13+
help:
14+
@grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
15+
16+
1217
devel-delete:
1318
kim image rm devopstales/kube-openid-connector:$(VERSION)-devel
1419

0 commit comments

Comments
 (0)