diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 887a454e..27a63329 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,6 @@ jobs: matrix: env: - TEST: pulp - - TEST: docs - TEST: azure - TEST: gcp - TEST: s3 diff --git a/README.md b/README.md index 3255c66d..e370e025 100644 --- a/README.md +++ b/README.md @@ -92,8 +92,6 @@ The following settings are stored in `template_config.yml`. latest_release_branch A pointer to the currently latest release branch (this is automatically updated). - docs_test Include a CI build for testing the 'make html' command for sphinx docs. - os_required_packages A list of packages to be installed on the host OS (Ubuntu) in the build step. @@ -229,12 +227,12 @@ provided by the plugin-template. # Add Documentation to a Pulp plugin -The next step is to add documentation that can be hosted on -[Read the Docs](https://readthedocs.org/). - -1. Run the `./plugin-template --docs` command to generate the docs. +The next step is to add documentation. +Pulp has a dedicated documentation tool that aggregates docs from subscribed plugins and handles +its publishing. - ``$ ./plugin-template --docs PLUGIN_NAME`` +To learn more about how it works and how to include your plugin, check out +[pulp-docs documentation](https://pulpproject.org/pulp-docs/docs/dev/). ## Discoverability @@ -263,7 +261,7 @@ pulpcore.plugin.PulpPluginAppConfig]({{ plugin_name | snake }}/app/__init__.py) # Customizing Plugin Behavior -First, look at the [overview](https://docs.pulpproject.org/pulpcore/plugins/plugin-writer/concepts/index.html) of Pulp Models to understand how Pulp fits these pieces together. +First, look at the [overview](https://pulpproject.org/pulpcore/docs/dev/learn/plugin-concepts/) of Pulp Models to understand how Pulp fits these pieces together. Bootstrapping created various new endpoints (e.g. remote, repository and content). Additional information should be added to these to tell Pulp how to handle your content. diff --git a/plugin-template b/plugin-template index 30b3cd1d..85a1c762 100755 --- a/plugin-template +++ b/plugin-template @@ -28,15 +28,12 @@ DEFAULT_SETTINGS = { "ci_base_image": "ghcr.io/pulp/pulp-ci-centos9", "ci_env": {}, "ci_trigger": "{pull_request: {branches: ['*']}}", - "ci_update_docs": True, "core_import_allowed": [], "deploy_client_to_pypi": True, "deploy_client_to_rubygems": True, "deploy_to_pypi": True, "disabled_redis_runners": [], - "doc_requirements_from_pulpcore": False, "docker_fixtures": False, - "docs_test": True, "flake8_ignore": [], "flake8": True, "github_org": "pulp", @@ -124,6 +121,12 @@ DEPRECATED_FILES = { ], } +DOCS_OPTION_DEPRECATION_INFO = """\ +'--docs' option is deprecated (July, 2024): + Most docs intervention are now handled by pulp-docs. + See https://github.com/pulp/pulp-docs.\ +""" + def main(): parser = argparse.ArgumentParser( @@ -194,9 +197,11 @@ def main(): "--docs", action="store_true", help=textwrap.dedent( - """\ + f"""\ Generate or update plugin documentation. + {DOCS_OPTION_DEPRECATION_INFO} + """ ), ) @@ -276,12 +281,6 @@ def main(): "\nLoaded plugin template config from " "{path}/template_config.yml.\n".format(path=plugin_root_dir) ) - if not config["docs_test"]: - if config["ci_update_docs"]: - print("There's no use updating the docs pipeline without using it.") - print("Disabling 'ci_update_docs'.") - config["ci_update_docs"] = False - write_new_config = True if args.verbose: print("\nUsing the following config:\n") @@ -334,6 +333,9 @@ def main(): if getattr(args, section) or args.all ] for section in sections: + if section == "docs": + print(DOCS_OPTION_DEPRECATION_INFO) + continue write_template_section(config, section, plugin_root_dir, verbose=args.verbose) if write_new_config and not (args.generate_config or args.all): diff --git a/templates/bootstrap/.bumpversion.cfg.j2 b/templates/bootstrap/.bumpversion.cfg.j2 index cd361b69..a034cb4c 100644 --- a/templates/bootstrap/.bumpversion.cfg.j2 +++ b/templates/bootstrap/.bumpversion.cfg.j2 @@ -18,4 +18,3 @@ values = [bumpversion:file:./setup.py] -[bumpversion:file:./docs/conf.py] diff --git a/templates/bootstrap/.gitignore.j2 b/templates/bootstrap/.gitignore.j2 index a16abf9e..d4cd1996 100644 --- a/templates/bootstrap/.gitignore.j2 +++ b/templates/bootstrap/.gitignore.j2 @@ -64,10 +64,6 @@ instance/ # Scrapy stuff: .scrapy -# Sphinx documentation -docs/_build/ -docs/_static/ - # PyBuilder target/ diff --git a/templates/bootstrap/HISTORY.rst b/templates/bootstrap/HISTORY.rst deleted file mode 100644 index e69de29b..00000000 diff --git a/templates/bootstrap/README.md.j2 b/templates/bootstrap/README.md.j2 index e4933c1c..6176c254 100644 --- a/templates/bootstrap/README.md.j2 +++ b/templates/bootstrap/README.md.j2 @@ -2,7 +2,7 @@ A Pulp plugin to support hosting your own {{ plugin_app_label | dash }}. -For more information, please see the [documentation](docs/index.rst) or the [Pulp project page](https://pulpproject.org/). +For more information, please see the [documentation](docs/index.md) or the [Pulp project page](https://pulpproject.org/). How to File an Issue diff --git a/templates/docs/doc_requirements.txt.j2 b/templates/bootstrap/doc_requirements.txt.j2 similarity index 72% rename from templates/docs/doc_requirements.txt.j2 rename to templates/bootstrap/doc_requirements.txt.j2 index 6e0c20d8..182cc853 100644 --- a/templates/docs/doc_requirements.txt.j2 +++ b/templates/bootstrap/doc_requirements.txt.j2 @@ -1,5 +1,2 @@ {% include 'header.j2' %} --r requirements.txt -towncrier - pulp-docs @ git+https://github.com/pulp/pulp-docs@main diff --git a/templates/bootstrap/docs/contributing.rst.j2 b/templates/bootstrap/docs/contributing.rst.j2 deleted file mode 100644 index e582053e..00000000 --- a/templates/bootstrap/docs/contributing.rst.j2 +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../CONTRIBUTING.rst diff --git a/templates/bootstrap/docs/index.md.j2 b/templates/bootstrap/docs/index.md.j2 new file mode 100644 index 00000000..bf29f31a --- /dev/null +++ b/templates/bootstrap/docs/index.md.j2 @@ -0,0 +1,12 @@ +# Welcome to Pulp {{ plugin_label | upper }} + +The `{{ plugin_label | upper }}` plugin extends pulpcore to support hosting python packages. +This plugin is a part of the Pulp Project, and assumes some familiarity with the +[pulpcore documentation](site:pulpcore/). + +If you are just getting started, we recommend: + +- [Getting Started with {{ plugin_label | upper }}](site:{{ plugin_name }}/docs/tutorials/getting-started.md), + for a starting out with a common use case. + + diff --git a/templates/bootstrap/docs/workflows/index.rst.j2 b/templates/bootstrap/docs/workflows/index.rst.j2 deleted file mode 100644 index 7c5cdfce..00000000 --- a/templates/bootstrap/docs/workflows/index.rst.j2 +++ /dev/null @@ -1,33 +0,0 @@ -Workflows -========= - -If you have not yet installed the `{{ plugin_app_label | dash }}` plugin on your Pulp installation, please follow our -:doc:`../installation`. These documents will assume you have the environment installed and -ready to go. - -The REST API examples here use `httpie `_ to perform the requests. -The ``httpie`` commands below assume that the user executing the commands has a ``.netrc`` file -in the home directory. The ``.netrc`` should have the following configuration: - -.. code-block:: bash - - machine localhost - login admin - password admin - -If you configured the ``admin`` user with a different password, adjust the configuration -accordingly. If you prefer to specify the username and password with each request, please see -``httpie`` documentation on how to do that. - -To make these workflows copy/pastable, we make use of environment variables. The first variable to -set is the hostname and port:: - - $ export BASE_ADDR=http://:24817 - - -.. toctree:: - :maxdepth: 2 - - sync - upload - publish diff --git a/templates/bootstrap/docs/workflows/publish.rst.j2 b/templates/bootstrap/docs/workflows/publish.rst.j2 deleted file mode 100644 index d0fcad6c..00000000 --- a/templates/bootstrap/docs/workflows/publish.rst.j2 +++ /dev/null @@ -1,34 +0,0 @@ -Publish and Host -================ - -This section assumes that you have a repository with content in it. To do this, see the -:doc:`sync` or :doc:`upload` documentation. - -Create a Publication --------------------- - -Publications contain extra settings for how to publish:: - - $ http POST ${BASE_ADDR}/pulp/api/v3/publications/{{ plugin_app_label | dash }}/{{ plugin_app_label | dash }}/ repository=${REPO_HREF} - -Response:: - - { - "task": "/pulp/api/v3/tasks/e66fb408-5dce-42df-90ac-45580a0a78be/" - } - - -Host a Publication (Create a Distribution) --------------------------------------------- - -To host a publication, (which makes it consumable by a package manager), users create a distribution which -will serve the associated publication at ``/pulp/content/``:: - - $ http POST ${BASE_ADDR}/pulp/api/v3/distributions/{{ plugin_app_label | dash }}/{{ plugin_app_label | dash }}/ name='baz' base_path='foo' publication=${PUBLICATION_HREF} - -Response:: - - { - "task": "/pulp/api/v3/tasks/1974aa50-d862-4eb7-84a3-1dc4000f34bf/" - } - diff --git a/templates/bootstrap/docs/workflows/upload.rst.j2 b/templates/bootstrap/docs/workflows/upload.rst.j2 deleted file mode 100644 index 47b9e496..00000000 --- a/templates/bootstrap/docs/workflows/upload.rst.j2 +++ /dev/null @@ -1,52 +0,0 @@ -Upload and Manage Content -========================= - -Create a repository -------------------- - -If you don't already have a repository, create one:: - - $ http POST ${BASE_ADDR}/pulp/api/v3/repositories/{{ plugin_app_label | dash }}/{{ plugin_app_label | dash }}/ name=foo - -Response:: - - { - ... - "pulp_href": "/pulp/api/v3/repositories/{{ plugin_app_label | dash }}/{{ plugin_app_label | dash }}/9b19ceb7-11e1-4309-9f97-bcbab2ae38b6/", - ... - } - - -Upload a file to Pulp ---------------------- - -Each artifact in Pulp represents a file. They can be created during sync or created manually by uploading a file:: - - $ http --form POST ${BASE_ADDR}/pulp/api/v3/artifacts/ file@./my_content - -Response:: - - { - ... - "pulp_href": "/pulp/api/v3/artifacts/6f847a21-a177-4a49-ad47-86f415b3830d/", - ... - } - - -Create content from an artifact -------------------------------- - -Now that Pulp has the content, its time to make it into a unit of content:: - - $ http POST ${BASE_ADDR}/pulp/api/v3/content/{{ plugin_app_label | dash }}/{{ plugin_app_label | dash }} artifact=${ARTIFACT_HREF} relative_path=my_content - -Response:: - - {} - -Add content to a repository ---------------------------- - -Once there is a content unit, it can be added or removed:: - - $ http POST ${BASE_ADDR}${REPO_HREF}modify/ add_content_units:="[\"http://localhost:24817/pulp/api/v3/content/{{ plugin_app_label | dash }}/{{ plugin_app_label | dash }}/ae016be0-0499-4547-881f-c56a1d0186a6/\"]" diff --git a/templates/docs/docs/Makefile.j2 b/templates/docs/docs/Makefile.j2 deleted file mode 100644 index e25eb102..00000000 --- a/templates/docs/docs/Makefile.j2 +++ /dev/null @@ -1,194 +0,0 @@ -{% include 'header.j2' %} -# Makefile for Sphinx documentation -# - -SHELL := /bin/bash -# You can set these variables from the command line. -SPHINXOPTS = -W # turn warnings into errors -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build -DIAGRAM_BUILD_DIR = _diagrams -PULP_URL ?= http://localhost:24817 -PULP_API_ROOT ?= /pulp/ - -# Internal variables. -PULP_V3_API_JSON_URL := ${PULP_URL}${PULP_API_ROOT}api/v3/docs/api.json -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext diagrams - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " diagrams to make diagram images" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -rm -rf $(DIAGRAM_BUILD_DIR)/* - -install: - python3 -m venv pulpdocs - source pulpdocs/bin/activate && pip install -r ../doc_requirements.txt - -diagrams: -ifneq ($(wildcard diagrams_src), ) - mkdir -p $(DIAGRAM_BUILD_DIR) -ifneq ("$(wildcard pulpdocs/bin/activate)","") - source pulpdocs/bin/activate && python3 -m plantuml diagrams_src/*.dot -else - python3 -m plantuml diagrams_src/*.dot -endif - mv diagrams_src/*.png $(DIAGRAM_BUILD_DIR)/ -else - @echo "Did not find $(DIAGRAM_SOURCE_DIR)." -endif - -$(BUILDDIR)/html/api.json: - mkdir -p $(BUILDDIR)/html - if pulp debug has-plugin --name core --specifier ">=3.44.0.dev"; \ - then \ - curl --fail -o $(BUILDDIR)/html/api.json "$(PULP_V3_API_JSON_URL)?component={{ plugins | map(attribute="app_label") | join(",") | default(plugin_app_label, True) }}&include_html=1"; \ - else \ - curl --fail -o $(BUILDDIR)/html/api.json "$(PULP_V3_API_JSON_URL)?plugin={{ plugin_name | snake }}&include_html=1"; \ - fi - -html: $(BUILDDIR)/html/api.json - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: -ifneq ("$(wildcard pulpdocs/bin/activate)","") - source pulpdocs/bin/activate && PULP_CONTENT_ORIGIN=localhost $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml -else - PULP_CONTENT_ORIGIN=localhost $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml -endif - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PulpDocs.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PulpDocs.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/PulpDocs" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PulpDocs" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -run: - cd $(BUILDDIR) && python -m http.server 8010 diff --git a/templates/docs/docs/_templates/restapi.html.j2 b/templates/docs/docs/_templates/restapi.html.j2 deleted file mode 100644 index 8cffcd4d..00000000 --- a/templates/docs/docs/_templates/restapi.html.j2 +++ /dev/null @@ -1,28 +0,0 @@ - - - - {% if plugin_name == "pulpcore" -%} - Pulp 3 REST API documentation - {%- else -%} - REST API for Pulp 3 {{ plugin_app_label | dash }} Plugin - {%- endif %} - - - - - - - - - - - - - diff --git a/templates/docs/docs/changes.rst.j2 b/templates/docs/docs/changes.rst.j2 deleted file mode 100644 index 5183811f..00000000 --- a/templates/docs/docs/changes.rst.j2 +++ /dev/null @@ -1,6 +0,0 @@ -Changes -********* - -.. _{{ plugin_name | snake }}-changes: - -.. include:: ../HISTORY.rst diff --git a/templates/docs/docs/static/.gitkeep b/templates/docs/docs/static/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/templates/docs/docs/template_gitref.j2 b/templates/docs/docs/template_gitref.j2 deleted file mode 100644 index 35ca903a..00000000 --- a/templates/docs/docs/template_gitref.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ gitref }} diff --git a/templates/github/.github/workflows/ci.yml.j2 b/templates/github/.github/workflows/ci.yml.j2 index 72f1d63e..a780e065 100644 --- a/templates/github/.github/workflows/ci.yml.j2 +++ b/templates/github/.github/workflows/ci.yml.j2 @@ -43,6 +43,10 @@ jobs: {%- endif %} {%- endif %} + docs: + if: "endsWith(github.base_ref, 'main')" + uses: "./.github/workflows/docs.yml" + lint: {%- if pre_job_template %} needs: {{ pre_job_template.name }} @@ -88,6 +92,7 @@ jobs: {%- endif %} - "lint" - "test" + - "docs" if: "always()" steps: - name: "Collect needed jobs results" diff --git a/templates/github/.github/workflows/docs.yml.j2 b/templates/github/.github/workflows/docs.yml.j2 new file mode 100644 index 00000000..d553db26 --- /dev/null +++ b/templates/github/.github/workflows/docs.yml.j2 @@ -0,0 +1,34 @@ +{% include 'header.j2' %} +{% from 'macros.j2' import + checkout, + setup_python, + install_python_deps, +with context %} +--- +name: "Docs" +on: + workflow_call: + +defaults: + run: + working-directory: "{{ plugin_name }}" + +jobs: + test: + runs-on: "ubuntu-20.04" + steps: + {{ checkout(depth=1, path=plugin_name) | indent(6) }} + {{ setup_python() | indent(6) }} + - name: "Setup cache key" + run: | + git ls-remote https://github.com/pulp/pulp-docs main | tee pulp-docs-main-sha + - uses: "actions/cache@v4" + with: + path: "~/.cache/pip" + key: {{ "${{ runner.os }}-pip-${{ hashFiles('pulp-docs-main-sha') }}" }} + restore-keys: | + {{ "${{ runner.os }}-pip-" }} + {{ install_python_deps(["-r", "doc_requirements.txt"]) | indent(6) }} + - name: "Build docs" + run: | + pulp-docs build diff --git a/templates/github/.github/workflows/scripts/install.sh.j2 b/templates/github/.github/workflows/scripts/install.sh.j2 index 82ce8641..378b98a1 100755 --- a/templates/github/.github/workflows/scripts/install.sh.j2 +++ b/templates/github/.github/workflows/scripts/install.sh.j2 @@ -16,25 +16,18 @@ PLUGIN_SOURCE="./{{ plugin_name }}/dist/{{ plugin_name | snake }}-${PLUGIN_VERSI export PULP_API_ROOT="{{ api_root }}" PIP_REQUIREMENTS=("{{ cli_package }}") -if [[ "$TEST" = "docs" || "$TEST" = "publish" ]] -then - PIP_REQUIREMENTS+=("-r" "doc_requirements.txt") {%- if plugin_name == 'pulpcore' %} +if [[ "$TEST" = "publish" ]] +then PIP_REQUIREMENTS+=("psycopg2-binary") -{%- elif doc_requirements_from_pulpcore %} - git clone https://github.com/pulp/pulpcore.git ../pulpcore - PIP_REQUIREMENTS+=("psycopg2-binary" "-r" "../pulpcore/doc_requirements.txt") -{%- endif %} fi +{%- endif %} pip install ${PIP_REQUIREMENTS[*]} {% if test_cli -%} -if [[ "$TEST" != "docs" ]] -then - PULP_CLI_VERSION="$(pip freeze | sed -n -e 's/{{ cli_package }}==//p')" - git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_package }} -fi +PULP_CLI_VERSION="$(pip freeze | sed -n -e 's/{{ cli_package }}==//p')" +git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_package }} {%- endif %} cd .ci/ansible/ @@ -191,9 +184,7 @@ fi pulp config create --base-url {{ pulp_scheme }}://pulp{% if pulp_scheme != 'https' %} --no-verify-ssl{% endif %} --api-root "$PULP_API_ROOT" --username "admin" --password "password" {% if test_cli -%} -if [[ "$TEST" != "docs" ]]; then - cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" -fi +cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml" {%- endif %} ansible-playbook build_container.yaml diff --git a/templates/github/.github/workflows/scripts/script.sh.j2 b/templates/github/.github/workflows/scripts/script.sh.j2 index 054540dd..f31e5865 100755 --- a/templates/github/.github/workflows/scripts/script.sh.j2 +++ b/templates/github/.github/workflows/scripts/script.sh.j2 @@ -13,7 +13,7 @@ source .github/workflows/scripts/utils.sh export POST_SCRIPT=$PWD/.github/workflows/scripts/post_script.sh export FUNC_TEST_SCRIPT=$PWD/.github/workflows/scripts/func_test_script.sh -# Needed for both starting the service and building the docs. +# Needed for starting the service # Gets set in .github/settings.yml, but doesn't seem to inherited by # this script. export DJANGO_SETTINGS_MODULE=pulpcore.app.settings @@ -21,14 +21,6 @@ export PULP_SETTINGS=$PWD/.ci/ansible/settings/settings.py export PULP_URL="{{ pulp_scheme }}://pulp" -if [[ "$TEST" = "docs" ]]; then - if [[ "$GITHUB_WORKFLOW" == "{{ plugin_app_label | camel | default("Pulp") }} CI" ]]; then - towncrier build --yes --version 4.0.0.ci - fi - pulp-docs build - exit -fi - REPORTED_STATUS="$(pulp status)" echo "machine pulp diff --git a/templates/github/.github/workflows/test.yml.j2 b/templates/github/.github/workflows/test.yml.j2 index f9ec1b39..f5b536cc 100644 --- a/templates/github/.github/workflows/test.yml.j2 +++ b/templates/github/.github/workflows/test.yml.j2 @@ -25,9 +25,6 @@ jobs: matrix: env: - TEST: pulp - {%- if docs_test %} - - TEST: docs - {%- endif %} {%- if test_azure %} - TEST: azure {%- endif %} diff --git a/templates/github/doc_requirements.txt.j2 b/templates/github/doc_requirements.txt.j2 new file mode 100644 index 00000000..182cc853 --- /dev/null +++ b/templates/github/doc_requirements.txt.j2 @@ -0,0 +1,2 @@ +{% include 'header.j2' %} +pulp-docs @ git+https://github.com/pulp/pulp-docs@main