From nobody Thu Sep 12 06:30:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683200036; cv=none; d=zohomail.com; s=zohoarc; b=lN7b6uLIuOiy5iATBuWzLRmWr0vc6z7ZVwhQ0nboYGlShR2nM+fonFJUb9fKyDYfl7OWLqk/75uCDqGuN2bW/gMe4VyDwUvGdE28UF0OjtanVcLSjGsUbi1R0GqxvFfxyrxMISnpXY+9vsk3zVMTTUMZC5OhQGCIByzbQ+5RwgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683200036; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GuRnfYRXUk4z3uNr9Hr+KBoyRXpHcPTAa5EacRK2N9Q=; b=gFgz5hP32w8ph20bPLHdrtMBTLKjQdVAopilsT5JC6iCzKJWL14TVv3xrSRO0Cbofz5iI+6ElH/3fDSxJ5pAv6W/KFaND0ugiB86rVMZ5rFRvpvmtEPrJwkwB0tNbglIR7L9dNK45pS3hr1WMH298BM6O5KV7Xeeii72Eta4dZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1683200036201923.1517922714127; Thu, 4 May 2023 04:33:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-yC_H8HJmNpmxE3cZ7t0fNA-1; Thu, 04 May 2023 07:33:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E262B38221C4; Thu, 4 May 2023 11:33:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA00C63F7E; Thu, 4 May 2023 11:33:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 80D531946A42; Thu, 4 May 2023 11:33:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E13F81946A43 for ; Thu, 4 May 2023 11:33:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3D5CDC15BB8; Thu, 4 May 2023 11:33:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0724C15BAD for ; Thu, 4 May 2023 11:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683200035; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GuRnfYRXUk4z3uNr9Hr+KBoyRXpHcPTAa5EacRK2N9Q=; b=Fz0skCUQSn3gGTBe+c4a0+Fe8WgJ9WlduwQCRdlkf0EhdqhVpBTMMEEAxTmk9YbWZLvZhE 9tvLq/OnAPTi61hzR6Ri9NgoSiELlFUlfP+KCDNGFRLaaH+8AIEt9PYTRftQwNZza4BFRc HiNhnlAt4Xiv1wiMHaI7zfiuy0p+CqY= X-MC-Unique: yC_H8HJmNpmxE3cZ7t0fNA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] gitlab-ci: Configure website build to be published via gitlab pages Date: Thu, 4 May 2023 13:33:32 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683200037638100001 Content-Type: text/plain; charset="utf-8" Modify the build process of the web page to publish the contents of the web page also via gitlab pages. This is achieved by the following steps: - the artifact is now named 'pages' - on push to the default branch a new job 'pages' is used - otherwise the old job names are used Signed-off-by: Peter Krempa --- .gitlab-ci.yml | 69 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a36c0ef18..df1074c518 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,22 +69,53 @@ include: - .gitlab_cross_build_job_local_env -# This artifact published by this job is downloaded by libvirt.org to -# be deployed to the web root: -# https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?j= ob=3Dwebsite +# This job builds the website and publishes it in the following ways: +# - 'pages' +# - publishing for gitlab pages +# - done only on push to the default branch +# - 'website*' +# - for CI purposes +# - job name based on how it was invoked: +# - 'website_prebuilt_env' +# - when the CI runs on the container images build by the upstream l= ibvirt project +# - 'website_local_env' +# - when run in locally-rebuilt environment +# +# The job exposes artifacts containing a directory named 'public'. +# +# 'libvirt.org' is currently populated from content got from: +# +# https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?j= ob=3Dpages +# +# which is unpacked and deployed to the web root. .website_job: script: - *script_variables - meson setup build --werror -Dsystem=3Dtrue || (cat build/meson-logs/= meson-log.txt && exit 1) - DESTDIR=3D$(pwd)/install ninja -C build install-web - - mv install/usr/share/doc/libvirt/html/ website + - mv install/usr/share/doc/libvirt/html/ public artifacts: - expose_as: 'Website' - name: 'website' - when: on_success - expire_in: 30 days + expose_as: 'pages' + name: 'pages' paths: - - website + - public + +pages: + extends: + - .website_job + needs: + - job: x86_64-almalinux-8-container + optional: true + variables: + NAME: almalinux-8 + stage: builds + image: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest + before_script: + - cat /packages.txt + rules: + - if: '$CI_PROJECT_NAMESPACE =3D=3D $RUN_UPSTREAM_NAMESPACE && $CI_PIP= ELINE_SOURCE =3D=3D "push" && $CI_COMMIT_BRANCH =3D=3D $CI_DEFAULT_BRANCH' + when: on_success + - when: never website_prebuilt_env: extends: @@ -95,6 +126,26 @@ website_prebuilt_env: optional: true variables: NAME: almalinux-8 + rules: + # forks: pushes to a branch when a pipeline run in upstream env is exp= licitly requested + - if: '$CI_PROJECT_NAMESPACE !=3D $RUN_UPSTREAM_NAMESPACE && $CI_PIPEL= INE_SOURCE =3D=3D "push" && $RUN_PIPELINE_UPSTREAM_ENV' + when: on_success + + # upstream: other web/api/scheduled pipelines targeting the default br= anch + - if: '$CI_PROJECT_NAMESPACE =3D=3D $RUN_UPSTREAM_NAMESPACE && $CI_PIP= ELINE_SOURCE =3D~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME =3D=3D $CI_DE= FAULT_BRANCH' + when: on_success + + # upstream+forks: merge requests targeting the default branch, without= CI changes + - if: '$CI_PIPELINE_SOURCE =3D=3D "merge_request_event" && $CI_MERGE_R= EQUEST_TARGET_BRANCH_NAME =3D=3D $CI_DEFAULT_BRANCH' + changes: + - ci/gitlab/container-templates.yml + - ci/containers/$NAME.Dockerfile + when: never + - if: '$CI_PIPELINE_SOURCE =3D=3D "merge_request_event" && $CI_MERGE_R= EQUEST_TARGET_BRANCH_NAME =3D=3D $CI_DEFAULT_BRANCH' + when: on_success + + # upstream+forks: that's all folks + - when: never website_local_env: extends: --=20 2.40.0 From nobody Thu Sep 12 06:30:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683200043; cv=none; d=zohomail.com; s=zohoarc; b=SYHaF2jxgs1t0I2vKRHZ7P3deiUz4puIrIbcCAyrAQCJskv8UhPgWAsRzGKB1oGrQO4J9QoxUXUicRXGB8AskyYV0Pz4Pa9q1l1ll/cyAmI4y5QWc3/H3wnIg1paQMvXnSROOo06Ord1DNRRrwUsZ9i/N2Am3g6zIjkCtAJbrZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683200043; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m8nd8Q3Yui6yDyeNNgnOsJ2g2wVf9kdCydNq0qUMY3g=; b=Qr6TMTvQiYhqkzAWJBNUPQqhIIII15r+WHKJLu2ZuqkUv74j5dA4reMYI/yD8ZDo+cXBKWCPIZ7jKKW9rzKVdJb7KdkoM2woiVzRBGkkyKyPslNtkswOkWi6ZKzyhEm6lYty7HMs1p5kBpVUVcHx1x8vqEEOtozYwxLU9VHwnks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1683200043428311.3443387261267; Thu, 4 May 2023 04:34:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-397-uWK9x6AsNvWQWW0lXdNVHg-1; Thu, 04 May 2023 07:33:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34AB43C23954; Thu, 4 May 2023 11:33:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C49F10DF8; Thu, 4 May 2023 11:33:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4B6D01946A42; Thu, 4 May 2023 11:33:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DD50C19465BB for ; Thu, 4 May 2023 11:33:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 10D0FC15BBA; Thu, 4 May 2023 11:33:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91F3AC15BAD for ; Thu, 4 May 2023 11:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683200042; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=m8nd8Q3Yui6yDyeNNgnOsJ2g2wVf9kdCydNq0qUMY3g=; b=Nd5+Y9t4KzEEVgC1U9vghDe0mrMzstDfeiUw0+1waCKfq6x7pWoSDRxqh/KUc4OvDM76B0 inj465s9e6rsZdvPLDokB74+z9+E7/tGLZzox7asr+JXz3D0qrKF5b2WAtqU0B6uOnvXb/ hU+2oxA+7a9t1Vd1PzwLXGsRtyTrJVg= X-MC-Unique: uWK9x6AsNvWQWW0lXdNVHg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] docs: Add redirects configuration for gitlab pages Date: Thu, 4 May 2023 13:33:33 +0200 Message-Id: <0aacb8991ea60be8fe53f5dfb40d1daea891b081.1683199667.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683200045522100001 Content-Type: text/plain; charset="utf-8" Adapt the configuration of redirects from the server hosting libvirt.org The redirect to the 'libvirt-console-proxy' Golang module is not adapted as it doesn't exist on the current server. NOTES: - The redirects are currently configured for hosting via the 'gitlab.io/libvirt' URI. For hosting via custom domain it will need to be rewritten to drop the '/libvirt' prefixes. - gitlab pages doesn't currently support redirects to outside content, thus most of the redirects don't actually work: https://gitlab.com/gitlab-org/gitlab-pages/-/issues/601 - The redirects file is only installed in the webpage job but is not actually distributed. Signed-off-by: Peter Krempa --- .gitlab-ci.yml | 1 + docs/.gitlab_redirects | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 docs/.gitlab_redirects diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df1074c518..f7aaac4150 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -94,6 +94,7 @@ include: - meson setup build --werror -Dsystem=3Dtrue || (cat build/meson-logs/= meson-log.txt && exit 1) - DESTDIR=3D$(pwd)/install ninja -C build install-web - mv install/usr/share/doc/libvirt/html/ public + - cp docs/.gitlab_redirects public/_redirects artifacts: expose_as: 'pages' name: 'pages' diff --git a/docs/.gitlab_redirects b/docs/.gitlab_redirects new file mode 100644 index 0000000000..d61d0ee07d --- /dev/null +++ b/docs/.gitlab_redirects @@ -0,0 +1,38 @@ +# Redirects to golang module pages +/libvirt/libvirt-go /libvirt-go.html 200 +/libvirt/libvirt-go-xml /libvirt-go-xml.html 200 +/libvirt/go/libvirt /go/libvirt.html 200 +/libvirt/go/libvirtxml /go/libvirtxml.html 200 + +# Redirects to the download server +/libvirt/sources/* https://download.libvirt.org/:splat 301 +/libvirt/ruby/download/* https://download.libvirt.org/ruby/:splat 301 +/libvirt/maven2/* https://download.libvirt.org/maven2/:splat 301 + +# Redirects to subproject pages +/libvirt/ruby/* https://ruby.libvirt.org/:splat 301 +/libvirt/ocaml/* https://ocaml.libvirt.org/:splat 301 +/libvirt/php/* https://php.libvirt.org/:splat 301 +/libvirt/libvirt-appdev-guide-python/en-US/html/* https://libvirt.gitlab.i= o/libvirt-appdev-guide-python/:splat: 301 +/libvirt/java.html https://java.libvirt.org 301 +# Redirect to the proper javadoc directory on the subproject page +/libvirt/sources/java/javadoc/* https://java.libvirt.org/javadoc/:splat 301 + +# Redirects to the old gitweb server +/libvirt/git/* https://git.libvirt.org/:splat 301 + +# The above rules are adapted from the following set of 'mod_rewrite' rule= s used +# originally on libvirt.org: +# +# RewriteRule ^/libvirt-go$ /libvirt-go.html [L] +# RewriteRule ^/libvirt-go-xml$ /libvirt-go-xml.html [L] +# RewriteRule ^/go/libvirt$ /go/libvirt.html [L] +# RewriteRule ^/go/libvirtxml$ /go/libvirtxml.html [L] +# RewriteRule ^/sources/(.*) https://download.libvirt.org/$1 [L] +# RewriteRule ^/ruby/download/(.*) https://download.libvirt.org/ruby/$1= [L] +# RewriteRule ^/(maven2/.*) https://download.libvirt.org/$1 [L] +# RewriteRule ^/ocaml/(.*) https://ocaml.libvirt.org/$1 [L] +# RewriteRule ^/ruby/(.*) https://ruby.libvirt.org/$1 [L] +# RewriteRule ^/php/(.*) https://php.libvirt.org/$1 [L] +# RewriteRule ^/java.html https://java.libvirt.org [L] +# RewriteRule ^/docs/libvirt-appdev-guide-python/en-US/html/(.*) https:= //libvirt.gitlab.io/libvirt-appdev-guide-python/$1 [L] --=20 2.40.0