diff mbox series

[1/4] gitlab: publish the docs built during CI

Message ID 20201102130926.161183-2-berrange@redhat.com
State Accepted
Commit 4daa9055beffa17ed47a71d52e7af219acc38e29
Headers show
Series [1/4] gitlab: publish the docs built during CI | expand

Commit Message

Daniel P. Berrangé Nov. 2, 2020, 1:09 p.m. UTC
Most of the build jobs will create the sphinx documentation. If we
expose this as an artifact of a "pages" job in a "public" directory, it
will get published using GitLab Pages. This means a user can push a
branch with docs changes to GitLab and view the results at

  https://yourusername.gitlab.io/qemu/

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

Comments

Philippe Mathieu-Daudé Nov. 2, 2020, 1:50 p.m. UTC | #1
On 11/2/20 2:09 PM, Daniel P. Berrangé wrote:
> Most of the build jobs will create the sphinx documentation. If we

> expose this as an artifact of a "pages" job in a "public" directory, it

> will get published using GitLab Pages. This means a user can push a

> branch with docs changes to GitLab and view the results at

> 

>   https://yourusername.gitlab.io/qemu/


Do we want that only for forks or also for the main repo?

For the main repo we need to keep older releases archived
but accessible.

> 

> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

> ---

>  .gitlab-ci.yml | 14 ++++++++++++++

>  1 file changed, 14 insertions(+)

> 

> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml

> index 3b15ae5c30..a41725d6f7 100644

> --- a/.gitlab-ci.yml

> +++ b/.gitlab-ci.yml

> @@ -423,3 +423,17 @@ check-dco:

>        - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'

>    variables:

>      GIT_DEPTH: 1000

> +

> +pages:

> +  image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest

> +  stage: test

> +  needs:

> +    - job: build-system-ubuntu

> +      artifacts: true

> +  script:

> +    - mkdir public


I'd rather use public/$CI_COMMIT_BRANCH, that way we can
diff between 2 versions.

What about adding a manual job to clean public/$CI_COMMIT_BRANCH?
(depending on push-pages success).

> +    - mv build/docs/index.html public/

> +    - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done

> +  artifacts:

> +    paths:

> +      - public

>
Daniel P. Berrangé Nov. 2, 2020, 2:21 p.m. UTC | #2
On Mon, Nov 02, 2020 at 02:50:19PM +0100, Philippe Mathieu-Daudé wrote:
> On 11/2/20 2:09 PM, Daniel P. Berrangé wrote:

> > Most of the build jobs will create the sphinx documentation. If we

> > expose this as an artifact of a "pages" job in a "public" directory, it

> > will get published using GitLab Pages. This means a user can push a

> > branch with docs changes to GitLab and view the results at

> > 

> >   https://yourusername.gitlab.io/qemu/

> 

> Do we want that only for forks or also for the main repo?

> 

> For the main repo we need to keep older releases archived

> but accessible.


I'm not suggesting we use this as the actual hosting we direct end
users to.

Instead, whatever cronjob on www.qemu.org currently builds

https://www.qemu.org/docs/master/

can simply download the published artifact from CI for the master
branch, and any release tags, and unpack them on www.qemu.org host.

IOW, we avoid need to run builds on www.qemu.org server.

> 

> > 

> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

> > ---

> >  .gitlab-ci.yml | 14 ++++++++++++++

> >  1 file changed, 14 insertions(+)

> > 

> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml

> > index 3b15ae5c30..a41725d6f7 100644

> > --- a/.gitlab-ci.yml

> > +++ b/.gitlab-ci.yml

> > @@ -423,3 +423,17 @@ check-dco:

> >        - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'

> >    variables:

> >      GIT_DEPTH: 1000

> > +

> > +pages:

> > +  image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest

> > +  stage: test

> > +  needs:

> > +    - job: build-system-ubuntu

> > +      artifacts: true

> > +  script:

> > +    - mkdir public

> 

> I'd rather use public/$CI_COMMIT_BRANCH, that way we can

> diff between 2 versions.

> 

> What about adding a manual job to clean public/$CI_COMMIT_BRANCH?

> (depending on push-pages success).


The publishing isn't additive - whatever is in the "public" dir
is exactly what is visible on gitlab pages. You can't publish
multiple different branches.

Essentially this "pages" job published an artifact containing
the entire content, and this is unpacked on the gitlab.io
service.

This is why I suggest www.qemu.org cronjob pull down the
artifact for "master", and also pull down the artifacts for
any release git tags, and unpack them in suitable subdirs.

> 

> > +    - mv build/docs/index.html public/

> > +    - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done

> > +  artifacts:

> > +    paths:

> > +      - public


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Philippe Mathieu-Daudé Nov. 2, 2020, 2:49 p.m. UTC | #3
On 11/2/20 3:21 PM, Daniel P. Berrangé wrote:
> On Mon, Nov 02, 2020 at 02:50:19PM +0100, Philippe Mathieu-Daudé wrote:

>> On 11/2/20 2:09 PM, Daniel P. Berrangé wrote:

>>> Most of the build jobs will create the sphinx documentation. If we

>>> expose this as an artifact of a "pages" job in a "public" directory, it

>>> will get published using GitLab Pages. This means a user can push a

>>> branch with docs changes to GitLab and view the results at

>>>

>>>   https://yourusername.gitlab.io/qemu/

>>

>> Do we want that only for forks or also for the main repo?

>>

>> For the main repo we need to keep older releases archived

>> but accessible.

> 

> I'm not suggesting we use this as the actual hosting we direct end

> users to.

> 

> Instead, whatever cronjob on www.qemu.org currently builds

> 

> https://www.qemu.org/docs/master/

> 

> can simply download the published artifact from CI for the master

> branch, and any release tags, and unpack them on www.qemu.org host.

> 

> IOW, we avoid need to run builds on www.qemu.org server.

> 

>>

>>>

>>> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

>>> ---

>>>  .gitlab-ci.yml | 14 ++++++++++++++

>>>  1 file changed, 14 insertions(+)

>>>

>>> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml

>>> index 3b15ae5c30..a41725d6f7 100644

>>> --- a/.gitlab-ci.yml

>>> +++ b/.gitlab-ci.yml

>>> @@ -423,3 +423,17 @@ check-dco:

>>>        - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'

>>>    variables:

>>>      GIT_DEPTH: 1000

>>> +

>>> +pages:

>>> +  image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest

>>> +  stage: test

>>> +  needs:

>>> +    - job: build-system-ubuntu

>>> +      artifacts: true

>>> +  script:

>>> +    - mkdir public

>>

>> I'd rather use public/$CI_COMMIT_BRANCH, that way we can

>> diff between 2 versions.

>>

>> What about adding a manual job to clean public/$CI_COMMIT_BRANCH?

>> (depending on push-pages success).

> 

> The publishing isn't additive - whatever is in the "public" dir

> is exactly what is visible on gitlab pages. You can't publish

> multiple different branches.


Oh OK.

Then:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>


> 

> Essentially this "pages" job published an artifact containing

> the entire content, and this is unpacked on the gitlab.io

> service.

> 

> This is why I suggest www.qemu.org cronjob pull down the

> artifact for "master", and also pull down the artifacts for

> any release git tags, and unpack them in suitable subdirs.

> 

>>

>>> +    - mv build/docs/index.html public/

>>> +    - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done

>>> +  artifacts:

>>> +    paths:

>>> +      - public

> 

> Regards,

> Daniel

>
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3b15ae5c30..a41725d6f7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -423,3 +423,17 @@  check-dco:
       - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
   variables:
     GIT_DEPTH: 1000
+
+pages:
+  image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest
+  stage: test
+  needs:
+    - job: build-system-ubuntu
+      artifacts: true
+  script:
+    - mkdir public
+    - mv build/docs/index.html public/
+    - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done
+  artifacts:
+    paths:
+      - public