Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 2.21 KB
/
Copy pathMakefile
File metadata and controls
69 lines (56 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
OC_GIT_BRANCH ?= main
export OC_GIT_BRANCH
DOC_GIT_BRANCH ?= main
DOC_GIT_BRANCH_TARGET ?= main
DOC_GIT_TARGET_FOLDER ?= tmpdocs/docs/dev/_static/env-vars/
.PHONY: all
all: git-checkdirexist go-mod-tidy
go run cmd/dochelpers/main.go all
.PHONY: templates
templates: go-mod-tidy
go run cmd/dochelpers/main.go templates
.PHONY: rogue
rogue: go-mod-tidy
go run cmd/dochelpers/main.go rogue
.PHONY: globals
globals: go-mod-tidy
go run cmd/dochelpers/main.go globals
.PHONY: service-index
service-index: go-mod-tidy
go run cmd/dochelpers/main.go service-index
.PHONY: env-var-delta-table
env-var-delta-table: go-mod-tidy
go run cmd/dochelpers/main.go env-var-delta-table
.PHONY: git-checkdirexist
git-checkdirexist:
@if [ ! -d "tmp" ]; then echo 'Directory tmp does not exist. Please run "make git-clone" first.';exit 1;fi
@if [ ! -d "tmpdocs" ]; then echo 'Directory tmpdocs does not exist. Please run "make git-clone" first.';exit 1;fi
@if [ -z "$$(ls -A tmp)" ]; then echo 'Directory tmp is empty. Please run "make git-clone" first.';exit 1;fi
.PHONY: git-clean
git-clean:
rm -rf tmp
rm -rf tmpdocs
.PHONY: git-clone
git-clone: git-clean
@if [ -d "tmp" ]; then echo "Directory tmp already exists. Please remove it before cloning.";exit 1;fi
git clone -b "${OC_GIT_BRANCH}" https://github.com/opencloud-eu/opencloud.git tmp
@if [ -d "tmpdocs" ]; then echo "Directory tmpdocs already exists. Please remove it before cloning.";exit 1;fi
git clone -b "${DOC_GIT_BRANCH}" git@github.com:opencloud-eu/docs tmpdocs; cd tmpdocs && git checkout -b docs-update-$$(uuidgen | tr '[:upper:]' '[:lower:]') && cd ..
.PHONY: clean
clean: git-clean output-clean
.PHONY: output-clean
output-clean:
rm -Rfv output/*
.PHONY: go-mod-tidy
go-mod-tidy:
go mod tidy
.PHONY: create-docs-pullrequest
create-docs-pullrequest:
mkdir -p "${DOC_GIT_TARGET_FOLDER}" && \
cp -Rfv output/docs/* "${DOC_GIT_TARGET_FOLDER}" && \
cd tmpdocs && \
git config --add --bool push.autoSetupRemote true && \
git add * && \
git commit -m "Update docs with latest env vars" && \
git push && \
gh pr create --title "Update docs" --body "This PR updates the documentation." --draft --label "Docs:Build&Tools" --label "Docs:CiWeeklyCleanup" --base "${DOC_GIT_BRANCH_TARGET}"