diff --git a/.woodpecker/docs.yaml b/.woodpecker/docs.yaml index df0cb3875..37e5b8d0a 100644 --- a/.woodpecker/docs.yaml +++ b/.woodpecker/docs.yaml @@ -37,15 +37,6 @@ when: evaluate: 'TASK == "docs"' steps: - build-cli: - image: *golang_image - commands: - - make docs - when: - - path: *when_path - event: [tag, pull_request, push] - - event: manual - build: image: *node_image directory: docs/ diff --git a/Makefile b/Makefile index dadacae45..63242ec52 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ clean: ## Clean build artifacts clean-all: clean ## Clean all artifacts rm -rf ${DIST_DIR} web/dist docs/build docs/node_modules web/node_modules # delete generated - rm -rf docs/docs/40-cli.md docs/openapi.json + rm -rf docs/openapi.json .PHONY: generate generate: install-tools generate-openapi ## Run all code generations @@ -216,6 +216,11 @@ build-tarball: ## Build tar archive .PHONY: build build: build-agent build-server build-cli ## Build all binaries +##@ Docs + +build-docs: + cd docs; pnpm install --frozen-lockfile; pnpm build + release-frontend: build-frontend ## Build frontend cross-compile-server: ## Cross compile the server @@ -336,10 +341,4 @@ spellcheck: -I versioned_docs -I '*opensource.svg' | \ pnpx cspell lint --no-progress stdin -##@ Docs -.PHONY: docs -docs: ## Generate docs (currently only for the cli) - CGO_ENABLED=0 go generate cmd/cli/app.go - CGO_ENABLED=0 go generate cmd/server/openapi.go - endif diff --git a/cmd/cli/docs.go b/cmd/cli/docs.go deleted file mode 100644 index d8dae41de..000000000 --- a/cmd/cli/docs.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Woodpecker Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build generate -// +build generate - -package main - -import ( - "os" - - docs "github.com/urfave/cli-docs/v3" -) - -func main() { - app := newApp() - md, err := docs.ToMarkdown(app) - if err != nil { - panic(err) - } - - fi, err := os.Create("../../docs/docs/40-cli.md") - if err != nil { - panic(err) - } - defer fi.Close() - if _, err := fi.WriteString("# CLI\n\n" + md); err != nil { - panic(err) - } -}