Work in progress
Some checks failed
Build container image for testing the Fedora Docs / build (push) Failing after 1m42s
Build fedocs container image for Fedora Docs / build (x86_64, latest, buildroot) (push) Successful in 2m57s
Build Antora container image for Fedora Docs / build (x86_64, latest, buildroot) (push) Successful in 3m37s
Build fedocs container image for Fedora Docs / merge (x86_64, latest, buildroot) (push) Successful in 43s
Build Antora container image for Fedora Docs / merge (x86_64, latest, buildroot) (push) Successful in 40s
Some checks failed
Build container image for testing the Fedora Docs / build (push) Failing after 1m42s
Build fedocs container image for Fedora Docs / build (x86_64, latest, buildroot) (push) Successful in 2m57s
Build Antora container image for Fedora Docs / build (x86_64, latest, buildroot) (push) Successful in 3m37s
Build fedocs container image for Fedora Docs / merge (x86_64, latest, buildroot) (push) Successful in 43s
Build Antora container image for Fedora Docs / merge (x86_64, latest, buildroot) (push) Successful in 40s
Signed-off-by: Hristo Marinov <hricky@fedoraproject.org>
This commit is contained in:
parent
0fda254f1a
commit
0e36fb930b
2 changed files with 66 additions and 74 deletions
|
|
@ -1,38 +1,40 @@
|
|||
# SPDX-FileCopyrightText: Fedora Docs maintainers
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: "Build container image for testing the Fedora Council Docs"
|
||||
name: "Build container image for testing the Fedora Docs"
|
||||
|
||||
env:
|
||||
CONTAINERFILE: "./build-site-container/Containerfile"
|
||||
CONTAINERFILE: "./build-scripts/Dockerfile"
|
||||
REGISTRY: "quay.io/fedora-docs"
|
||||
IMAGE: "council-docs-test"
|
||||
IMAGE: "docs-test"
|
||||
TAGS: "latest"
|
||||
|
||||
BASEIMAGE_REPO: "quay.io/fedora/fedora-minimal"
|
||||
BASEIMAGE_TAG: "45"
|
||||
# BASEIMAGE_REPO: "quay.io/fedora/fedora-minimal"
|
||||
# BASEIMAGE_TAG: "45"
|
||||
|
||||
RUNNERIMAGE_REPO: "quay.io/fedora-docs/buildroot"
|
||||
RUNNERIMAGE_TAG: "latest"
|
||||
|
||||
CHUNKAH_REPO: "quay.io/coreos/chunkah"
|
||||
CHUNKAH_TAG: "dev"
|
||||
CHUNKAH_TMP_OCIARCHIVE: "chunkah"
|
||||
# chunkah's own image needs an EL10-built rpm-sequoia for PQC support we
|
||||
# don't need (see Containerfile comment); we extract its binary onto a
|
||||
# plain Fedora rootfs instead, pinned to the Fedora release chunkah's own
|
||||
# image is built against to avoid an ABI mismatch.
|
||||
CHUNKAH_TOOL_BASE_TAG: "44"
|
||||
# CHUNKAH_REPO: "quay.io/coreos/chunkah"
|
||||
# CHUNKAH_TAG: "dev"
|
||||
# CHUNKAH_TMP_OCIARCHIVE: "chunkah"
|
||||
# # chunkah's own image needs an EL10-built rpm-sequoia for PQC support we
|
||||
# # don't need (see Containerfile comment); we extract its binary onto a
|
||||
# # plain Fedora rootfs instead, pinned to the Fedora release chunkah's own
|
||||
# # image is built against to avoid an ABI mismatch.
|
||||
# CHUNKAH_TOOL_BASE_TAG: "44"
|
||||
|
||||
PLAYBOOK_PATH: "./site-council-docs-test.yaml"
|
||||
# PLAYBOOK_PATH: "./site-council-docs-test.yaml"
|
||||
|
||||
NODEJS_VERSION: "26"
|
||||
# NODEJS_VERSION: "26"
|
||||
|
||||
IMAGE_TITLE: "Fedora Docs"
|
||||
IMAGE_DESCRIPTION: "Container image for testing the Fedora Council Docs"
|
||||
IMAGE_SOURCE: "https://forge.fedoraproject.org/docs/docs-fp-o"
|
||||
IMAGE_LICENSES: "MIT"
|
||||
QUAY_EXPIRES_AFTER: "4w"
|
||||
# IMAGE_TITLE: "Fedora Docs"
|
||||
# IMAGE_DESCRIPTION: "Container image for testing the Fedora Docs"
|
||||
# IMAGE_SOURCE: "https://forge.fedoraproject.org/docs/docs-fp-o"
|
||||
# IMAGE_LICENSES: "MIT"
|
||||
# QUAY_EXPIRES_AFTER: "4w"
|
||||
|
||||
BUILD_ENV: "stg"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
|
@ -64,15 +66,15 @@ jobs:
|
|||
- name: "Checkout repo"
|
||||
uses: https://github.com/actions/checkout@v7
|
||||
|
||||
- name: "Determine Antora version"
|
||||
id: antora-version
|
||||
run: |
|
||||
set -xeuo pipefail
|
||||
readonly ANTORA_VERSION=$(curl --silent \
|
||||
"https://gitlab.com/api/v4/projects/4180516/repository/tags?order_by=updated&sort=desc&per_page=1" \
|
||||
| jq --raw-output '.[].name[1:]')
|
||||
echo "version=${ANTORA_VERSION}" >> "${FORGEJO_OUTPUT}"
|
||||
# echo "version=3.1.15" >> "${FORGEJO_OUTPUT}"
|
||||
# - name: "Determine Antora version"
|
||||
# id: antora-version
|
||||
# run: |
|
||||
# set -xeuo pipefail
|
||||
# readonly ANTORA_VERSION=$(curl --silent \
|
||||
# "https://gitlab.com/api/v4/projects/4180516/repository/tags?order_by=updated&sort=desc&per_page=1" \
|
||||
# | jq --raw-output '.[].name[1:]')
|
||||
# echo "version=${ANTORA_VERSION}" >> "${FORGEJO_OUTPUT}"
|
||||
# # echo "version=3.1.15" >> "${FORGEJO_OUTPUT}"
|
||||
|
||||
- name: "Build container image"
|
||||
uses: https://github.com/redhat-actions/buildah-build@v3
|
||||
|
|
@ -82,24 +84,25 @@ jobs:
|
|||
containerfiles: ${{ env.CONTAINERFILE }}
|
||||
oci: true
|
||||
build-args: |
|
||||
BASEIMAGE_REPO=${{ env.BASEIMAGE_REPO }}
|
||||
BASEIMAGE_TAG=${{ env.BASEIMAGE_TAG }}
|
||||
CHUNKAH_REPO=${{ env.CHUNKAH_REPO }}
|
||||
CHUNKAH_TAG=${{ env.CHUNKAH_TAG }}
|
||||
CHUNKAH_TMP_OCIARCHIVE=${{ env.CHUNKAH_TMP_OCIARCHIVE }}
|
||||
CHUNKAH_TOOL_BASE_IMAGE=${{ env.BASEIMAGE_REPO }}:${{ env.CHUNKAH_TOOL_BASE_TAG }}
|
||||
IMAGE_TITLE=${{ env.IMAGE_TITLE }}
|
||||
IMAGE_DESCRIPTION=${{ env.IMAGE_DESCRIPTION }}
|
||||
IMAGE_SOURCE=${{ env.IMAGE_SOURCE }}
|
||||
IMAGE_LICENSES=${{ env.IMAGE_LICENSES }}
|
||||
QUAY_EXPIRES_AFTER=${{ env.QUAY_EXPIRES_AFTER }}
|
||||
BUILD_ENV=${{ env.BUILD_ENV }}
|
||||
# BASEIMAGE_REPO=${{ env.BASEIMAGE_REPO }}
|
||||
# BASEIMAGE_TAG=${{ env.BASEIMAGE_TAG }}
|
||||
# CHUNKAH_REPO=${{ env.CHUNKAH_REPO }}
|
||||
# CHUNKAH_TAG=${{ env.CHUNKAH_TAG }}
|
||||
# CHUNKAH_TMP_OCIARCHIVE=${{ env.CHUNKAH_TMP_OCIARCHIVE }}
|
||||
# CHUNKAH_TOOL_BASE_IMAGE=${{ env.BASEIMAGE_REPO }}:${{ env.CHUNKAH_TOOL_BASE_TAG }}
|
||||
# IMAGE_TITLE=${{ env.IMAGE_TITLE }}
|
||||
# IMAGE_DESCRIPTION=${{ env.IMAGE_DESCRIPTION }}
|
||||
# IMAGE_SOURCE=${{ env.IMAGE_SOURCE }}
|
||||
# IMAGE_LICENSES=${{ env.IMAGE_LICENSES }}
|
||||
# QUAY_EXPIRES_AFTER=${{ env.QUAY_EXPIRES_AFTER }}
|
||||
extra-args: |
|
||||
--pull=newer
|
||||
--no-cache
|
||||
--skip-unused-stages=false
|
||||
--env PLAYBOOK_PATH=${{ env.PLAYBOOK_PATH }}
|
||||
--env NODEJS_VERSION=${{ env.NODEJS_VERSION }}
|
||||
--env ANTORA_VERSION=${{ steps.antora-version.outputs.version }}
|
||||
# --skip-unused-stages=false
|
||||
# --env PLAYBOOK_PATH=${{ env.PLAYBOOK_PATH }}
|
||||
# --env NODEJS_VERSION=${{ env.NODEJS_VERSION }}
|
||||
# --env ANTORA_VERSION=${{ steps.antora-version.outputs.version }}
|
||||
|
||||
- name: "Login to Container Registry"
|
||||
uses: https://github.com/redhat-actions/podman-login@v2
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env python3
|
||||
#!/usr/bin/python3
|
||||
|
||||
|
||||
# The script requires the following environment variables to be set:
|
||||
|
|
@ -7,19 +7,14 @@
|
|||
# -----------------|-----------------------------------------------------------
|
||||
# BUILD_ENV prod Build the production version of the site
|
||||
# using the "prod" branch. DEFAULT
|
||||
#
|
||||
# stg Build the staging version of the site
|
||||
# using the "stg" branch.
|
||||
# -----------------|-----------------------------------------------------------
|
||||
# BUILD_LANGS english Build the "en-US" version only. DEFAULT
|
||||
#
|
||||
# translated Build only the translated versions.
|
||||
#
|
||||
# all Build the "en-US" and the translated versions.
|
||||
# -----------------|-----------------------------------------------------------
|
||||
# PLAYBOOK_PATH <path> Path to the Antora playbook file to use
|
||||
# for building the documentation.
|
||||
# DEFAULT: site.yml
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
import tempfile
|
||||
|
|
@ -39,22 +34,18 @@ import re
|
|||
def get_config():
|
||||
config = {}
|
||||
|
||||
config["docs_repo_url"] = os.getenv(
|
||||
"DOCS_REPO_URL",
|
||||
"https://forge.fedoraproject.org/docs/docs-fp-o.git")
|
||||
|
||||
config["docs_repo_branch"] = os.getenv(
|
||||
"BUILD_ENV",
|
||||
"prod")
|
||||
|
||||
config["playbook_path"] = os.getenv(
|
||||
"PLAYBOOK_PATH",
|
||||
None)
|
||||
|
||||
config["build_langs"] = os.getenv(
|
||||
"BUILD_LANGS",
|
||||
"english")
|
||||
|
||||
config["docs_repo_url"] = os.getenv(
|
||||
"DOCS_REPO_URL",
|
||||
"https://forge.fedoraproject.org/docs/docs-fp-o.git")
|
||||
|
||||
config["translated_sources_repo_url"] = os.getenv(
|
||||
"TRANSLATED_SOURCES_REPO_URL",
|
||||
"https://forge.fedoraproject.org/docs/translated-sources.git"
|
||||
|
|
@ -176,6 +167,7 @@ def prefetch_sources(original_sources, site_yml, config):
|
|||
if re.search(r"://forge.fedoraproject.org", repo_data['url']):
|
||||
weburl = repo_data['url'].strip('.git')
|
||||
repo_data['edit_url'] = f"{weburl}/src/branch/{{refname}}/{{path}}"
|
||||
repo_data['origin'] = repo_data['url']
|
||||
repo_data['url'] = dirname
|
||||
|
||||
branches = repo_data.get("branches", default_branch)
|
||||
|
|
@ -183,6 +175,11 @@ def prefetch_sources(original_sources, site_yml, config):
|
|||
branches = [branches]
|
||||
|
||||
for branch in branches:
|
||||
antora_path = dirname
|
||||
if "start_path" in repo_data:
|
||||
antora_path = os.path.join(dirname, repo_data["start_path"])
|
||||
if "antora.yml" not in os.listdir(antora_path):
|
||||
log(f"WARNING: antora.yml not detected in {repo_data['origin']} branch:{branch}")
|
||||
y = get_metadata_from_branch(branch, repo_data['url'])
|
||||
if dirname in metadata:
|
||||
metadata[dirname][branch] = y
|
||||
|
|
@ -377,8 +374,7 @@ def main():
|
|||
#####--------------------------------------#####
|
||||
|
||||
# Location of the docs-fp-o repo
|
||||
# docs_repo = os.path.join(workdir, "docs_repo")
|
||||
docs_repo = "/antora"
|
||||
docs_repo = os.path.join(workdir, "docs_repo")
|
||||
|
||||
# Location of the translated sources used for the build
|
||||
# (That's the translated-sources repo with the missing files added
|
||||
|
|
@ -388,17 +384,10 @@ def main():
|
|||
|
||||
log("")
|
||||
log("===== Getting the site definition (site.yml) =====")
|
||||
# Use local playbook if PLAYBOOK_PATH is set, otherwise clone
|
||||
if config.get("playbook_path"):
|
||||
# Load from provided playbook path
|
||||
log(f"Loading playbook from: {config['playbook_path']}")
|
||||
with open(config["playbook_path"], "r") as file:
|
||||
original_site_yml = yaml.safe_load(file)
|
||||
else:
|
||||
# Clone and load from repo
|
||||
subprocess.run(["git", "clone", "--branch", config["docs_repo_branch"], "--depth=1", config["docs_repo_url"], docs_repo])
|
||||
with open(os.path.join(docs_repo, "site.yml"), "r") as file:
|
||||
original_site_yml = yaml.safe_load(file)
|
||||
subprocess.run(["git", "clone", "--branch", config["docs_repo_branch"], "--depth=1", config["docs_repo_url"], docs_repo])
|
||||
|
||||
with open(os.path.join(docs_repo, "site.yml"), "r") as file:
|
||||
original_site_yml = yaml.safe_load(file)
|
||||
|
||||
log("")
|
||||
log("===== Getting a list of languages =====")
|
||||
|
|
@ -484,7 +473,6 @@ def main():
|
|||
##### Translated site build #####
|
||||
#####--------------------------------------#####
|
||||
|
||||
|
||||
if config["build_langs"] == "translated" or config["build_langs"] == "all":
|
||||
|
||||
log("")
|
||||
|
|
@ -609,3 +597,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue