Skip to content

Commit 412b3cd

Browse files
committed
Remove sumodules.
1 parent 18b5383 commit 412b3cd

File tree

13 files changed

+85
-47
lines changed

13 files changed

+85
-47
lines changed

.gitmodules

-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +0,0 @@
1-
[submodule "docs/src/external/mini-lab"]
2-
path = docs/src/external/mini-lab
3-
url = https://github.com/metal-stack/mini-lab.git
4-
[submodule "docs/src/external/metalctl"]
5-
path = docs/src/external/metalctl
6-
url = https://github.com/metal-stack/metalctl.git
7-
[submodule "docs/src/external/csi-lvm"]
8-
path = docs/src/external/csi-lvm
9-
url = https://github.com/metal-stack/csi-lvm.git
10-
[submodule "docs/src/external/firewall-controller"]
11-
path = docs/src/external/firewall-controller
12-
url = https://github.com/metal-stack/firewall-controller.git

Dockerfile.updater

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ubuntu:20.04
2+
RUN apt update \
3+
&& apt install -y git curl \
4+
&& curl -Lo /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64 \
5+
&& chmod +x /usr/local/bin/yq

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@
44
build:
55
docker build -t docs-builder .
66
docker run -it --rm -v $(PWD)/docs:/workdir/docs -w /workdir docs-builder julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path="/workdir")); Pkg.resolve(); include("docs/make.jl")'
7+
8+
RELEASE_VERSION := $(or ${RELEASE_VERSION},master)
9+
.PHONY: update
10+
update:
11+
docker build -f Dockerfile.updater -t docs-updater .
12+
docker run -it --rm -v $(PWD):/workdir -w /workdir docs-updater bash -c "./update.sh $(RELEASE_VERSION)"

docs/src/apidocs/apidocs.md

+13
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22

33
In this section you will find links to the API documentation of metal-stack components.
44

5+
```@eval
6+
using Docs
7+
8+
metal_api_image = releaseVector()["docker-images"]["metal-stack"]["control-plane"]["metal-api"]["tag"]
9+
content = redocTemplate("metal-api", string("https://raw.githubusercontent.com/metal-stack/metal-api/", metal_api_image, "/spec/metal-api.json"))
10+
11+
f = open(string(@__DIR__, "/metal-api/index.html"), "w")
12+
write(f, content)
13+
close(f);
14+
15+
nothing
16+
```
17+
518
- [metal-api](metal-api/index.html)

docs/src/apidocs/metal-api/.gitkeep

Whitespace-only changes.

docs/src/apidocs/metal-api/index.html

-24
This file was deleted.

docs/src/external/csi-lvm

-1
This file was deleted.

docs/src/external/firewall-controller

-1
This file was deleted.

docs/src/external/metalctl

-1
This file was deleted.

docs/src/external/mini-lab

-1
This file was deleted.

docs/src/installation/deployment.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ t = """
7878
```
7979
"""
8080
81-
printMarkdown(t, ansible_common, metal_roles)
81+
markdownTemplate(t, ansible_common, metal_roles)
8282
````
8383

8484
!!! tip
@@ -171,7 +171,7 @@ metal_stack_version: %s
171171
```
172172
"""
173173
174-
printMarkdown(t, releaseVersion())
174+
markdownTemplate(t, releaseVersion())
175175
````
176176
177177
By the time you will certainly add more parametrization to the deployment. When this happens, feel free to split up your `all.yaml` into separate files to keep everything nice and pretty.
@@ -215,7 +215,7 @@ docker run --rm -it \
215215
```
216216
"""
217217

218-
printMarkdown(t, base_image)
218+
markdownTemplate(t, base_image)
219219
````
220220
221221
!!! tip

src/Docs.jl

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
module Docs
22
using YAML, HTTP, Markdown, Printf
33

4-
export releaseVersion, releaseVector, printMarkdown
4+
export releaseVersion, releaseVector, markdownTemplate, redocTemplate
55

6-
releaseVersion() = "master"
6+
redocTpl = raw"""
7+
<!DOCTYPE html>
8+
<html>
9+
<head>
10+
<title>%s</title>
11+
<meta charset="utf-8"/>
12+
<meta name="viewport" content="width=device-width, initial-scale=1">
13+
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
14+
15+
<style>
16+
body {
17+
margin: 0;
18+
padding: 0;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<redoc spec-url='%s'></redoc>
24+
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
25+
</body>
26+
</html>
27+
"""
28+
29+
releaseVersion() = get(ENV, "RELEASE_VERSION", "master")
730
releaseVector() = release_vector
831

932
r = HTTP.request("GET", string("https://raw.githubusercontent.com/metal-stack/releases/", releaseVersion(), "/release.yaml"))
1033
release_vector = YAML.load(String(r.body))
1134

12-
constsprintf(fmt::String,args...) = @eval @sprintf($fmt,$(args...))
35+
constsprintf(fmt::String, args...) = @eval @sprintf($fmt, $(args...))
1336

14-
function printMarkdown(t, x...)
37+
function markdownTemplate(t, x...)
1538
return Markdown.parse(constsprintf(t, x...))
1639
end
40+
41+
function redocTemplate(name, url)
42+
return constsprintf(redocTpl, name, url)
43+
end
1744
end

update.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -exo pipefail
3+
4+
version=$1
5+
6+
function update_repo() {
7+
path=$1
8+
git_url=$2
9+
ref=$3
10+
echo "Updating repository ${path}"
11+
rm -rf $path
12+
mkdir -p $path
13+
cd $path
14+
cd ..
15+
git clone $git_url --depth 1 --branch $ref --single-branch
16+
cd -
17+
ls -al
18+
find . -type f ! -name '*.md' -delete
19+
ls -al
20+
21+
}
22+
23+
echo "Getting release vector"
24+
curl -Lo /tmp/release.yaml "https://raw.githubusercontent.com/metal-stack/releases/${version}/release.yaml"
25+
26+
echo "Updating external repositories"
27+
update_repo "docs/src/external/csi-lvm" "https://github.com/metal-stack/csi-lvm.git" $(yq r /tmp/release.yaml 'docker-images.metal-stack.kubernetes.csi-lvm-controller.tag')

0 commit comments

Comments
 (0)