All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: thuth@redhat.com, qemu-devel@nongnu.org
Subject: Re: [qemu-web PATCH v2] deploy to qemu-project.org from GitLab CI
Date: Tue, 19 Jan 2021 10:47:31 +0000	[thread overview]
Message-ID: <20210119104731.GC1830870@redhat.com> (raw)
In-Reply-To: <20210119101549.294716-1-pbonzini@redhat.com>

On Tue, Jan 19, 2021 at 11:15:49AM +0100, Paolo Bonzini wrote:
> Currently, the website is rebuilt on qemu-project.org using
> an update hook.  We can reuse instead the Jekyll output of
> GitLab's CI.
> 
> To do so, a new user qemu-deploy has been created on qemu.org.
> The private key is stored into a file variable SSH_PRIVATE_KEY_FILE
> (be careful to include the trailing newline after "---END OPENSSH
> PRIVATE KEY---"!).
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 5fa3041..129b2ff 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,6 +1,11 @@
>  
> +stages:
> +  - build
> +  - update
> +
>  pages:
>    image: centos:8
> +  stage: build
>    cache:
>      paths:
>        - vendor
> @@ -14,3 +19,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 && rsync -az root/ new"
> +    - rsync -avz --delete public/ $SSH_DEPLOY_DESTINATION:/var/www/qemu-project.org/new
> +    - ssh $SSH_DEPLOY_DESTINATION "cd /var/www/qemu-project.org && rm -rf old && mv root old && mv new root"
> +  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 :|



      reply	other threads:[~2021-01-19 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 10:15 [qemu-web PATCH v2] deploy to qemu-project.org from GitLab CI Paolo Bonzini
2021-01-19 10:47 ` Daniel P. Berrangé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210119104731.GC1830870@redhat.com \
    --to=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.