All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] deploy docs to qemu-project.org from GitLab CI
@ 2021-01-19 14:40 Paolo Bonzini
  2021-01-19 14:54 ` Daniel P. Berrangé
  2021-01-19 16:14 ` Thomas Huth
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-01-19 14:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, alex.bennee, stefanha

Currently, the website is rebuilt on qemu-project.org using
a separate container (https://github.com/stefanha/qemu-docs/)
cron job hook.  We can instead reuse the GitLab's CI artifacts.

To do so, we use the same mechanism that is already in place for
qemu-web.git.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
        v1->v2: use same image and before_script as qemu-web.git

 .gitlab-ci.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fd0162ad29..d9afc79b30 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ stages:
   - containers-layer2
   - build
   - test
+  - update
 
 include:
   - local: '/.gitlab-ci.d/edk2.yml'
@@ -627,3 +628,26 @@ pages:
   artifacts:
     paths:
       - public
+
+deploy:
+  image: centos:8
+  stage: update
+  needs:
+    - job: pages
+      artifacts: true
+  before_script:
+    - dnf install -y openssh-clients rsync
+    - eval $(ssh-agent -s)
+    - cat "$SSH_PRIVATE_KEY_FILE" | tr -d '\r' | ssh-add -
+    - mkdir -m700 -p ~/.ssh
+    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
+  script:
+    - ssh $SSH_DEPLOY_DESTINATION "cd /var/www/qemu-project.org && mkdir new-docs && rsync -az docs/ new-docs"
+    - rsync -avz --delete public/ $SSH_DEPLOY_DESTINATION:/var/www/qemu-project.org/new-docs
+    - ssh $SSH_DEPLOY_DESTINATION "cd /var/www/qemu-project.org && rm -rf old-docs && mv docs old-docs && mv new-docs docs"
+  only:
+    refs:
+      - master
+    variables:
+      - $SSH_PRIVATE_KEY_FILE
+      - $SSH_DEPLOY_DESTINATION
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] deploy docs to qemu-project.org from GitLab CI
  2021-01-19 14:40 [PATCH v2] deploy docs to qemu-project.org from GitLab CI Paolo Bonzini
@ 2021-01-19 14:54 ` Daniel P. Berrangé
  2021-01-19 16:14 ` Thomas Huth
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2021-01-19 14:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: alex.bennee, qemu-devel, stefanha

On Tue, Jan 19, 2021 at 03:40:32PM +0100, Paolo Bonzini wrote:
> Currently, the website is rebuilt on qemu-project.org using
> a separate container (https://github.com/stefanha/qemu-docs/)
> cron job hook.  We can instead reuse the GitLab's CI artifacts.
> 
> To do so, we use the same mechanism that is already in place for
> qemu-web.git.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>         v1->v2: use same image and before_script as qemu-web.git
> 
>  .gitlab-ci.yml | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index fd0162ad29..d9afc79b30 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -6,6 +6,7 @@ stages:
>    - containers-layer2
>    - build
>    - test
> +  - update
>  
>  include:
>    - local: '/.gitlab-ci.d/edk2.yml'
> @@ -627,3 +628,26 @@ pages:
>    artifacts:
>      paths:
>        - public
> +
> +deploy:
> +  image: centos:8
> +  stage: update
> +  needs:
> +    - job: pages
> +      artifacts: true
> +  before_script:
> +    - dnf install -y openssh-clients rsync
> +    - eval $(ssh-agent -s)
> +    - cat "$SSH_PRIVATE_KEY_FILE" | tr -d '\r' | ssh-add -
> +    - mkdir -m700 -p ~/.ssh
> +    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
> +  script:
> +    - ssh $SSH_DEPLOY_DESTINATION "cd /var/www/qemu-project.org && mkdir new-docs && rsync -az docs/ new-docs"
> +    - rsync -avz --delete public/ $SSH_DEPLOY_DESTINATION:/var/www/qemu-project.org/new-docs
> +    - ssh $SSH_DEPLOY_DESTINATION "cd /var/www/qemu-project.org && rm -rf old-docs && mv docs old-docs && mv new-docs docs"
> +  only:
> +    refs:
> +      - master
> +    variables:
> +      - $SSH_PRIVATE_KEY_FILE
> +      - $SSH_DEPLOY_DESTINATION

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


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 :|



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] deploy docs to qemu-project.org from GitLab CI
  2021-01-19 14:40 [PATCH v2] deploy docs to qemu-project.org from GitLab CI Paolo Bonzini
  2021-01-19 14:54 ` Daniel P. Berrangé
@ 2021-01-19 16:14 ` Thomas Huth
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2021-01-19 16:14 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: alex.bennee, berrange, stefanha

On 19/01/2021 15.40, Paolo Bonzini wrote:
> Currently, the website is rebuilt on qemu-project.org using
> a separate container (https://github.com/stefanha/qemu-docs/)
> cron job hook.  We can instead reuse the GitLab's CI artifacts.
> 
> To do so, we use the same mechanism that is already in place for
> qemu-web.git.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>          v1->v2: use same image and before_script as qemu-web.git
> 
>   .gitlab-ci.yml | 24 ++++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index fd0162ad29..d9afc79b30 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -6,6 +6,7 @@ stages:
>     - containers-layer2
>     - build
>     - test
> +  - update

Could you please also update the comment at the very top of the yml file? It 
currently says that there are only two stages after the container stage, but 
now you're adding a third one.

  Thanks,
   Thomas



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-19 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 14:40 [PATCH v2] deploy docs to qemu-project.org from GitLab CI Paolo Bonzini
2021-01-19 14:54 ` Daniel P. Berrangé
2021-01-19 16:14 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.