Skip to content

Commit c3ec1bb

Browse files
Makefile: replace build-docs by generate
1 parent 65f5224 commit c3ec1bb

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

.github/workflows/ensure-docs-compiled.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
uses: actions/checkout@v2
1010
- uses: actions/setup-go@v4
1111
- shell: bash
12-
run: make build-docs
12+
run: make generate
1313
- shell: bash
1414
run: |
1515
if [[ -z "$(git status -s)" ]]; then
1616
echo "OK"
1717
else
1818
echo "Docs have been updated, but the compiled docs have not been committed."
19-
echo "Run 'make build-docs', and commit the result to resolve this error."
19+
echo "Run 'make generate', and commit the result to resolve this error."
2020
exit 1
2121
fi
2222

Makefile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GOBIN=$(shell go env GOBIN)
1010
endif
1111

1212
PACKER_SDC=$(GOBIN)/packer-sdc
13-
PACKER_SDC_RENDER_DOCS=$(PACKER_SDC) renderdocs -src docs-src/ -partials docs-partials/ -dst docs/
13+
PACKER_SDC_RENDER_DOCS=$(PACKER_SDC) renderdocs -src docs-src/ -partials docs-partials/ -dst .docs/
1414

1515

1616
default: build
@@ -36,16 +36,15 @@ install: build
3636
install-packer-sdc: ## Install packer sofware development command
3737
go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@$(HASHICORP_PACKER_PLUGIN_SDK_VERSION)
3838

39-
ci-release-docs: install-packer-sdc generate
40-
@/bin/sh -c "[ -d docs ] && zip -x docs/README.mdx -r docs.zip docs/"
41-
4239
plugin-check: install-packer-sdc build
4340
$(PACKER_SDC) plugin-check $(BINARY)
4441

4542
generate: fmt install-packer-sdc
4643
@PATH=$(PATH):$(GOBIN) go generate ./...
47-
@rm -fr $(CURDIR)/docs # renderdocs doesn't seem to properly overwrite files
44+
@if [ -d ".docs" ]; then rm -r ".docs"; fi
4845
$(PACKER_SDC_RENDER_DOCS)
46+
@./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "UpCloudLtd"
47+
@rm -r ".docs"
4948

5049
fmt:
5150
packer fmt builder/upcloud/test-fixtures/hcl2
@@ -57,10 +56,4 @@ clean:
5756
find . -name "TestBuilderAcc_*" -delete
5857
find . -name "packer-plugin-upcloud" -delete
5958

60-
build-docs: install-packer-sdc
61-
@if [ -d ".docs" ]; then rm -r ".docs"; fi
62-
@packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/"
63-
@./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "UpCloudLtd"
64-
@rm -r ".docs"
65-
6659
.PHONY: default test test_integration lint build install build-docs

0 commit comments

Comments
 (0)