Skip to content
Snippets Groups Projects
Verified Commit d96bc24f authored by Adrián Rošinec's avatar Adrián Rošinec
Browse files

Deployment of einfra docs

parent d0a065db
No related branches found
No related tags found
No related merge requests found
Pipeline #156804 failed
......@@ -53,10 +53,9 @@ ext_links:
stage: after_test
image: it4innovations/docker-mkdocscheck:latest
before_script:
- echo "192.168.101.10 docs.it4i.cz" >> /etc/hosts
- wget -V
- echo https://docs.it4i.cz/devel/$CI_BUILD_REF_NAME/
- wget --spider -e robots=off -o wget.log -r -p https://docs.it4i.cz/devel/$CI_BUILD_REF_NAME/ || true
- echo https://${HOSTING_HOST}/review/$CI_BUILD_REF_NAME/
- wget --spider -e robots=off -o wget.log -r -p https://${HOSTING_HOST}/review/$CI_BUILD_REF_NAME/ || true
script:
- cat wget.log | awk '/^Found [0-9]+ broken link[s]?.$/,/FINISHED/ { rc=-1; print $0 }; END { exit rc }'
......@@ -94,47 +93,48 @@ mkdocs:
- site
expire_in: 1 week
deploy to stage:
environment: stage
.prepare_deploy: &prepare_deploy
stage: deploy
image: it4innovations/docker-mkdocscheck:latest
before_script:
# install ssh-agent
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
# run ssh-agent
- eval $(ssh-agent -s)
# add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# disable host key checking (NOTE: makes you susceptible to man-in-the-middle attacks)
# WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
before_script:
- apk update && apk add rsync
- eval $(ssh-agent -s)
- echo "$SSH_HOSTING_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS__HOSTING" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
deploy production:
needs: ["build_docs"]
environment:
name: production
url: https://${HOSTING_HOST}
script:
- chown nginx:nginx site -R
- rsync -a --delete site/ root@"$SSH_HOST_STAGE":/srv/docs.it4i.cz/devel/$CI_BUILD_REF_NAME/
- rsync -a -e "ssh -o StrictHostKeyChecking=no" --delete --exclude=/review site/ ${HOSTING_USERNAME}@${HOSTING_HOST}:~/public_html
only:
- branches@sccs/docs.it4i.cz
- master
<<: *prepare_deploy
deploy to production:
environment: production
stage: deploy
image: it4innovations/docker-mkdocscheck:latest
before_script:
# install ssh-agent
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
# run ssh-agent
- eval $(ssh-agent -s)
# add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# disable host key checking (NOTE: makes you susceptible to man-in-the-middle attacks)
# WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
deploy dev:
needs: ["build_docs"]
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://${HOSTING_HOST}/review/$CI_COMMIT_REF_SLUG
<<: *prepare_deploy
script:
- chown nginx:nginx site -R
- rsync -a --delete site/ root@"$SSH_HOST_STAGE":/srv/docs.it4i.cz/site/
only:
- master@sccs/docs.it4i.cz
when: manual
- rsync -a -e "ssh -o StrictHostKeyChecking=no" --delete --exclude=/review site/ ${HOSTING_USERNAME}@${HOSTING_HOST}:~/public_html/review/$CI_COMMIT_REF_SLUG
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: never
- if: $CI_COMMIT_BRANCH
stop_review:
<<: *prepare_deploy
script:
- ssh -o StrictHostKeyChecking=no ${HOSTING_USERNAME}@${HOSTING_HOST} rm -rf ~/public_html/review/$CI_COMMIT_REF_SLUG
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
rules:
- if: $CI_MERGE_REQUEST_ID
when: manual
site_name: IT4Innovations Documentation
site_name: e-INFRA.CZ Documentation
docs_dir: docs.it4i
site_url: https://docs.it4i.cz/
site_url: https://docs.e-infra.cz/
extra_css:
- src/css.css?id=2018100501
- https://unpkg.com/mermaid@7.0.5/dist/mermaid.css
......@@ -13,7 +13,7 @@ repo_name: sccs/docs.it4i.cz
repo_url: https://code.it4i.cz/sccs/docs.it4i.cz
# Copyright
copyright: Copyright (c) 2013-__YEAR__ IT4Innovations__VERSION__
copyright: Copyright (c) 2013-__YEAR__ e-infra.cz - e-infrastructure for research __VERSION__
theme:
name: material
......@@ -28,10 +28,9 @@ theme:
- navigation.tabs
#- tabs
#- instant
icon:
logo: fontawesome/solid/book-open
repo: fontawesome/brands/gitlab
# icon:
# logo: fontawesome/solid/book-open
# repo: fontawesome/brands/gitlab
# Don't include MkDocs' JavaScript
include_search_page: false
......@@ -240,13 +239,13 @@ nav:
- VESTA: software/viz/vesta.md
- PBS Pro Documentation: pbspro.md
extra:
disqus: 'test-3whnesz3gq'
social:
- icon: 'fontawesome/brands/gitlab'
link: 'https://code.it4i.cz/sccs/docs.it4i.cz'
- icon: fontawesome/solid/globe-europe
link: https://www.it4i.cz
#extra:
# disqus: 'test-3whnesz3gq'
# social:
# - icon: 'fontawesome/brands/gitlab'
# link: 'https://code.it4i.cz/sccs/docs.it4i.cz'
# - icon: fontawesome/solid/globe-europe
# link: https://www.it4i.cz
plugins:
- search:
......@@ -267,6 +266,6 @@ markdown_extensions:
- footnotes
- pymdownx.superfences
google_analytics:
- 'UA-90498826-1'
- 'auto'
#google_analytics:
# - 'UA-90498826-1'
# - 'auto'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment