[libvirt PATCH v2 1/9] gitlab: use CI for building website contents

Daniel P. Berrangé posted 9 patches 5 years, 10 months ago
[libvirt PATCH v2 1/9] gitlab: use CI for building website contents
Posted by Daniel P. Berrangé 5 years, 10 months ago
Run the bare minimum build that is possible to create the docs. Ideally
the '--without-remote' arg would be passed, but there are several bugs
preventing a build from succeeding without the remote driver built.

The generated website is published as an artifact and thus is browsable
on build completion and can be downloaded as a zip file.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .gitlab-ci.yml | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ea49c6178b..180861f082 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -44,3 +44,24 @@ debian-sid-cross-i686:
 debian-sid-cross-mipsel:
   <<: *job_definition
   image: quay.io/libvirt/buildenv-libvirt-debian-sid-cross-mipsel:latest
+
+# 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?job=website
+website:
+  script:
+    - mkdir build
+    - cd build
+    - ../autogen.sh --prefix=$(pwd)/../vroot || (cat config.log && exit 1)
+    - make -j $(getconf _NPROCESSORS_ONLN) -C docs
+    - make -j $(getconf _NPROCESSORS_ONLN) -C docs install
+    - cd ..
+    - mv vroot/share/doc/libvirt/html/ website
+  image: quay.io/libvirt/buildenv-libvirt-fedora-31:latest
+  artifacts:
+    expose_as: 'Website'
+    name: 'website'
+    when: on_success
+    expire_in: 30 days
+    paths:
+      - website
-- 
2.24.1

Re: [libvirt PATCH v2 1/9] gitlab: use CI for building website contents
Posted by Andrea Bolognani 5 years, 10 months ago
On Tue, 2020-03-24 at 16:23 +0000, Daniel P. Berrangé wrote:
> Run the bare minimum build that is possible to create the docs. Ideally
> the '--without-remote' arg would be passed, but there are several bugs
> preventing a build from succeeding without the remote driver built.

This comment is no longer necessary, is it?

[...]
> +# 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?job=website
> +website:
> +  script:
> +    - mkdir build
> +    - cd build
> +    - ../autogen.sh --prefix=$(pwd)/../vroot || (cat config.log && exit 1)
> +    - make -j $(getconf _NPROCESSORS_ONLN) -C docs
> +    - make -j $(getconf _NPROCESSORS_ONLN) -C docs install

Can you please make patch 7/9 the first in the series, so that you
don't need to go back and change this to $MAKE later?

> +    - cd ..
> +    - mv vroot/share/doc/libvirt/html/ website
> +  image: quay.io/libvirt/buildenv-libvirt-fedora-31:latest

Since the build job is running on Fedora 31 (at the moment), would
it make sense to call it website-fedora-31? The name of the artifact
would remain the same, so eg. the cron job we're going to have on
libvirt.org will not need to be modified every time we bump this.

> +  artifacts:
> +    expose_as: 'Website'
> +    name: 'website'

I'm not sure the quotes are necessary. Either way, we can remove
them later if they turn out not to be.

-- 
Andrea Bolognani / Red Hat / Virtualization

Re: [libvirt PATCH v2 1/9] gitlab: use CI for building website contents
Posted by Erik Skultety 5 years, 10 months ago
On Tue, Mar 24, 2020 at 06:26:15PM +0100, Andrea Bolognani wrote:
> On Tue, 2020-03-24 at 16:23 +0000, Daniel P. Berrangé wrote:
> > Run the bare minimum build that is possible to create the docs. Ideally
> > the '--without-remote' arg would be passed, but there are several bugs
> > preventing a build from succeeding without the remote driver built.
>
> This comment is no longer necessary, is it?
>
> [...]
> > +# 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?job=website
> > +website:
> > +  script:
> > +    - mkdir build
> > +    - cd build
> > +    - ../autogen.sh --prefix=$(pwd)/../vroot || (cat config.log && exit 1)
> > +    - make -j $(getconf _NPROCESSORS_ONLN) -C docs
> > +    - make -j $(getconf _NPROCESSORS_ONLN) -C docs install
>
> Can you please make patch 7/9 the first in the series, so that you
> don't need to go back and change this to $MAKE later?

I concur.

>
> > +    - cd ..
> > +    - mv vroot/share/doc/libvirt/html/ website
> > +  image: quay.io/libvirt/buildenv-libvirt-fedora-31:latest
>
> Since the build job is running on Fedora 31 (at the moment), would
> it make sense to call it website-fedora-31? The name of the artifact
> would remain the same, so eg. the cron job we're going to have on
> libvirt.org will not need to be modified every time we bump this.

The website job is generic, meaning we don't care which distro it is being run
on, so I'd rather not force the naming conventionby including the distro name.

Reviewed-by: Erik Skultety <eskultet@redhat.com>