Skip to content

Commit 7b44835

Browse files
committed
docs page
Signed-off-by: Mangirdas Judeikis <Mangirdas@Judeikis.LT> On-behalf-of: SAP mangirdas.judeikis@sap.com
1 parent 3cfb842 commit 7b44835

38 files changed

Lines changed: 1832 additions & 3 deletions
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Generate and push docs
2+
3+
on:
4+
# So we can trigger manually if needed
5+
workflow_dispatch:
6+
# To confirm any changes to docs build successfully, without deploying them
7+
pull_request:
8+
# Pushes to branches do the full build + deployment
9+
push:
10+
branches:
11+
- main
12+
- "release-*"
13+
paths:
14+
- "cmd/**"
15+
- "docs/**"
16+
- "pkg/**"
17+
- ".github/workflows/docs-gen-and-push.yaml"
18+
19+
permissions:
20+
contents: write
21+
22+
concurrency:
23+
group: ${{ github.workflow }}
24+
25+
jobs:
26+
generate-and-push:
27+
name: Generate and push docs
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- run: git fetch origin gh-pages
33+
- run: git fetch origin '+refs/tags/v*:refs/tags/v*' --no-tags
34+
35+
- uses: actions/setup-go@v5
36+
with:
37+
go-version: v1.23.4
38+
cache: true
39+
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.10'
43+
cache: 'pip'
44+
45+
- run: make generate-cli-docs generate-api-docs deploy-docs

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ coverage.*
1212
/hack/tools
1313
/build
1414
/dex
15-
/bin
15+
/bin
16+
docs/generators/cli-doc/cli-doc

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,29 @@ verify: verify-modules verify-go-versions verify-imports verify-codegen verify-b
304304
.PHONY: help
305305
help: ## Show this help.
306306
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
307+
308+
.PHONY: generate-cli-docs
309+
generate-cli-docs: ## Generate cli docs
310+
git clean -fdX docs/content/reference/cli
311+
pushd . && cd docs/generators/cli-doc && go build . && popd
312+
./docs/generators/cli-doc/cli-doc -output docs/content/reference/cli
313+
314+
.PHONY: generate-api-docs
315+
generate-api-docs: ## Generate api docs
316+
git clean -fdX docs/content/reference/api
317+
docs/generators/crd-ref/run-crd-ref-gen.sh
318+
319+
VENVDIR=$(abspath docs/venv)
320+
REQUIREMENTS_TXT=docs/requirements.txt
321+
322+
.PHONY: serve-docs
323+
serve-docs: venv ## Serve docs
324+
. $(VENV)/activate; \
325+
VENV=$(VENV) REMOTE=$(REMOTE) BRANCH=$(BRANCH) docs/scripts/serve-docs.sh
326+
327+
.PHONY: deploy-docs
328+
deploy-docs: venv ## Deploy docs
329+
. $(VENV)/activate; \
330+
REMOTE=$(REMOTE) BRANCH=$(BRANCH) docs/scripts/deploy-docs.sh
331+
332+
include Makefile.venv

Makefile.venv

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
#
2+
# SEAMLESSLY MANAGE PYTHON VIRTUAL ENVIRONMENT WITH A MAKEFILE
3+
#
4+
# https://github.com/sio/Makefile.venv v2022.07.20
5+
#
6+
#
7+
# Insert `include Makefile.venv` at the bottom of your Makefile to enable these
8+
# rules.
9+
#
10+
# When writing your Makefile use '$(VENV)/python' to refer to the Python
11+
# interpreter within virtual environment and '$(VENV)/executablename' for any
12+
# other executable in venv.
13+
#
14+
# This Makefile provides the following targets:
15+
# venv
16+
# Use this as a dependency for any target that requires virtual
17+
# environment to be created and configured
18+
# python, ipython
19+
# Use these to launch interactive Python shell within virtual environment
20+
# shell, bash, zsh
21+
# Launch interactive command line shell. "shell" target launches the
22+
# default shell Makefile executes its rules in (usually /bin/sh).
23+
# "bash" and "zsh" can be used to refer to the specific desired shell.
24+
# show-venv
25+
# Show versions of Python and pip, and the path to the virtual environment
26+
# clean-venv
27+
# Remove virtual environment
28+
# $(VENV)/executable_name
29+
# Install `executable_name` with pip. Only packages with names matching
30+
# the name of the corresponding executable are supported.
31+
# Use this as a lightweight mechanism for development dependencies
32+
# tracking. E.g. for one-off tools that are not required in every
33+
# developer's environment, therefore are not included into
34+
# requirements.txt or setup.py.
35+
# Note:
36+
# Rules using such target or dependency MUST be defined below
37+
# `include` directive to make use of correct $(VENV) value.
38+
# Example:
39+
# codestyle: $(VENV)/pyflakes
40+
# $(VENV)/pyflakes .
41+
# See `ipython` target below for another example.
42+
#
43+
# This Makefile can be configured via following variables:
44+
# PY
45+
# Command name for system Python interpreter. It is used only initially to
46+
# create the virtual environment
47+
# Default: python3
48+
# REQUIREMENTS_TXT
49+
# Space separated list of paths to requirements.txt files.
50+
# Paths are resolved relative to current working directory.
51+
# Default: requirements.txt
52+
#
53+
# Non-existent files are treated as hard dependencies,
54+
# recipes for creating such files must be provided by the main Makefile.
55+
# Providing empty value (REQUIREMENTS_TXT=) turns off processing of
56+
# requirements.txt even when the file exists.
57+
# SETUP_PY
58+
# Space separated list of paths to setup.py files.
59+
# Corresponding packages will be installed into venv in editable mode
60+
# along with all their dependencies
61+
# Default: setup.py
62+
#
63+
# Non-existent and empty values are treated in the same way as for REQUIREMENTS_TXT.
64+
# WORKDIR
65+
# Parent directory for the virtual environment.
66+
# Default: current working directory.
67+
# VENVDIR
68+
# Python virtual environment directory.
69+
# Default: $(WORKDIR)/.venv
70+
#
71+
# This Makefile was written for GNU Make and may not work with other make
72+
# implementations.
73+
#
74+
#
75+
# Copyright (c) 2019-2020 Vitaly Potyarkin
76+
#
77+
# Licensed under the Apache License, Version 2.0
78+
# <http://www.apache.org/licenses/LICENSE-2.0>
79+
#
80+
81+
82+
#
83+
# Configuration variables
84+
#
85+
86+
WORKDIR?=.
87+
VENVDIR?=$(WORKDIR)/.venv
88+
REQUIREMENTS_TXT?=$(wildcard requirements.txt) # Multiple paths are supported (space separated)
89+
SETUP_PY?=$(wildcard setup.py) # Multiple paths are supported (space separated)
90+
SETUP_CFG?=$(foreach s,$(SETUP_PY),$(wildcard $(patsubst %setup.py,%setup.cfg,$(s))))
91+
MARKER=.initialized-with-Makefile.venv
92+
93+
94+
#
95+
# Python interpreter detection
96+
#
97+
98+
_PY_AUTODETECT_MSG=Detected Python interpreter: $(PY). Use PY environment variable to override
99+
100+
ifeq (ok,$(shell test -e /dev/null 2>&1 && echo ok))
101+
NULL_STDERR=2>/dev/null
102+
else
103+
NULL_STDERR=2>NUL
104+
endif
105+
106+
ifndef PY
107+
_PY_OPTION:=python3
108+
ifeq (ok,$(shell $(_PY_OPTION) -c "print('ok')" $(NULL_STDERR)))
109+
PY=$(_PY_OPTION)
110+
endif
111+
endif
112+
113+
ifndef PY
114+
_PY_OPTION:=$(VENVDIR)/bin/python
115+
ifeq (ok,$(shell $(_PY_OPTION) -c "print('ok')" $(NULL_STDERR)))
116+
PY=$(_PY_OPTION)
117+
$(info $(_PY_AUTODETECT_MSG))
118+
endif
119+
endif
120+
121+
ifndef PY
122+
_PY_OPTION:=$(subst /,\,$(VENVDIR)/Scripts/python)
123+
ifeq (ok,$(shell $(_PY_OPTION) -c "print('ok')" $(NULL_STDERR)))
124+
PY=$(_PY_OPTION)
125+
$(info $(_PY_AUTODETECT_MSG))
126+
endif
127+
endif
128+
129+
ifndef PY
130+
_PY_OPTION:=py -3
131+
ifeq (ok,$(shell $(_PY_OPTION) -c "print('ok')" $(NULL_STDERR)))
132+
PY=$(_PY_OPTION)
133+
$(info $(_PY_AUTODETECT_MSG))
134+
endif
135+
endif
136+
137+
ifndef PY
138+
_PY_OPTION:=python
139+
ifeq (ok,$(shell $(_PY_OPTION) -c "print('ok')" $(NULL_STDERR)))
140+
PY=$(_PY_OPTION)
141+
$(info $(_PY_AUTODETECT_MSG))
142+
endif
143+
endif
144+
145+
ifndef PY
146+
define _PY_AUTODETECT_ERR
147+
Could not detect Python interpreter automatically.
148+
Please specify path to interpreter via PY environment variable.
149+
endef
150+
$(error $(_PY_AUTODETECT_ERR))
151+
endif
152+
153+
154+
#
155+
# Internal variable resolution
156+
#
157+
158+
VENV=$(VENVDIR)/bin
159+
EXE=
160+
# Detect windows
161+
ifeq (win32,$(shell $(PY) -c "import __future__, sys; print(sys.platform)"))
162+
VENV=$(VENVDIR)/Scripts
163+
EXE=.exe
164+
endif
165+
166+
touch=touch $(1)
167+
ifeq (,$(shell command -v touch $(NULL_STDERR)))
168+
# https://ss64.com/nt/touch.html
169+
touch=type nul >> $(subst /,\,$(1)) && copy /y /b $(subst /,\,$(1))+,, $(subst /,\,$(1))
170+
endif
171+
172+
RM?=rm -f
173+
ifeq (,$(shell command -v $(firstword $(RM)) $(NULL_STDERR)))
174+
RMDIR:=rd /s /q
175+
else
176+
RMDIR:=$(RM) -r
177+
endif
178+
179+
180+
#
181+
# Virtual environment
182+
#
183+
184+
.PHONY: venv
185+
venv: $(VENV)/$(MARKER)
186+
187+
.PHONY: clean-venv
188+
clean-venv:
189+
-$(RMDIR) "$(VENVDIR)"
190+
191+
.PHONY: show-venv
192+
show-venv: venv
193+
@$(VENV)/python -c "import sys; print('Python ' + sys.version.replace('\n',''))"
194+
@$(VENV)/pip --version
195+
@echo venv: $(VENVDIR)
196+
197+
.PHONY: debug-venv
198+
debug-venv:
199+
@echo "PATH (Shell)=$$PATH"
200+
@$(MAKE) --version
201+
$(info PATH (GNU Make)="$(PATH)")
202+
$(info SHELL="$(SHELL)")
203+
$(info PY="$(PY)")
204+
$(info REQUIREMENTS_TXT="$(REQUIREMENTS_TXT)")
205+
$(info SETUP_PY="$(SETUP_PY)")
206+
$(info SETUP_CFG="$(SETUP_CFG)")
207+
$(info VENVDIR="$(VENVDIR)")
208+
$(info VENVDEPENDS="$(VENVDEPENDS)")
209+
$(info WORKDIR="$(WORKDIR)")
210+
211+
212+
#
213+
# Dependencies
214+
#
215+
216+
ifneq ($(strip $(REQUIREMENTS_TXT)),)
217+
VENVDEPENDS+=$(REQUIREMENTS_TXT)
218+
endif
219+
220+
ifneq ($(strip $(SETUP_PY)),)
221+
VENVDEPENDS+=$(SETUP_PY)
222+
endif
223+
ifneq ($(strip $(SETUP_CFG)),)
224+
VENVDEPENDS+=$(SETUP_CFG)
225+
endif
226+
227+
$(VENV):
228+
$(PY) -m venv $(VENVDIR)
229+
$(VENV)/python -m pip install --upgrade pip setuptools wheel
230+
231+
$(VENV)/$(MARKER): $(VENVDEPENDS) | $(VENV)
232+
ifneq ($(strip $(REQUIREMENTS_TXT)),)
233+
$(VENV)/pip install $(foreach path,$(REQUIREMENTS_TXT),-r $(path))
234+
endif
235+
ifneq ($(strip $(SETUP_PY)),)
236+
$(VENV)/pip install $(foreach path,$(SETUP_PY),-e $(dir $(path)))
237+
endif
238+
$(call touch,$(VENV)/$(MARKER))
239+
240+
241+
#
242+
# Interactive shells
243+
#
244+
245+
.PHONY: python
246+
python: venv
247+
exec $(VENV)/python
248+
249+
.PHONY: ipython
250+
ipython: $(VENV)/ipython
251+
exec $(VENV)/ipython
252+
253+
.PHONY: shell
254+
shell: venv
255+
. $(VENV)/activate && exec $(notdir $(SHELL))
256+
257+
.PHONY: bash zsh
258+
bash zsh: venv
259+
. $(VENV)/activate && exec $@
260+
261+
262+
#
263+
# Commandline tools (wildcard rule, executable name must match package name)
264+
#
265+
266+
ifneq ($(EXE),)
267+
$(VENV)/%: $(VENV)/%$(EXE) ;
268+
.PHONY: $(VENV)/%
269+
.PRECIOUS: $(VENV)/%$(EXE)
270+
endif
271+
272+
$(VENV)/%$(EXE): $(VENV)/$(MARKER)
273+
$(VENV)/pip install --upgrade $*
274+
$(call touch,$@)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $ kubectl get mangodbs
3333

3434
## For more information
3535

36-
For more information go to https://kubectl-bind.io or watch the [ContainerDays talk](https://www.youtube.com/watch?v=dg0g15Qv5Fo&t=1s)
36+
For more information go to https://kube-bind.io or watch the [ContainerDays talk](https://www.youtube.com/watch?v=dg0g15Qv5Fo&t=1s)
3737
or the [KubeCon talk](https://www.youtube.com/watch?v=Uv0ivz5xej4).
3838

3939
The kube-bind prototype is following this manifesto from the linked talk:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
func KubectlBindCommand() *cobra.Command {
3636
root := &cobra.Command{
3737
Use: "bind",
38-
Short: "kubectl plugin for kube-bind.io",
38+
Short: "kubectl plugin for Kube-Bind.io",
3939
Long: help.Doc(`
4040
kube-bind is a project that aims to provide better support for
4141
service providers and consumers that reside in distinct Kubernetes clusters.

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
venv
2+
generated
3+
__pycache__

0 commit comments

Comments
 (0)