Newer
Older
docs:
stage: test
image: davidhrbac/docker-mdcheck:latest
allow_failure: true
script:
two spaces:
stage: test
image: davidhrbac/docker-mdcheck:latest
allow_failure: true
script:
- echo "== Files having more than one space betwee two characters =="
- find docs.it4i/ -name '*.md' -exec grep "[[:alpha:]] [[:alpha:]]" -l {} + || true
capitalize:
stage: test
image: davidhrbac/docker-mkdocscheck:latest
allow_failure: true
script:
- find docs.it4i/ -name '*.md' -print0 | xargs -0 -n1 scripts/titlemd_test.py
- mdspell '**/*.md' '!docs.it4i/module*.md' '!docs.it4i/anselm-cluster-documentation/software/omics-master/overview.md' '!docs.it4i/downtimes_history.md' -rns --en-us
#- find docs.it4i/ -name '*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10
#- find docs.it4i/ -name '*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
- >
COMMIT_MESSAGE=$(git log -1 --pretty=%B | grep "Merge branch 'hot_fix' into 'master'" )
if [[ ${COMMIT_MESSAGE} == *hot_fix* ]]; then
echo "Skipping ci build"
exit 0
else
find docs.it4i/ -name '*.md' ! -name 'modules-*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
fi
image: davidhrbac/docker-mkdocscheck:latest
script:
# regenerate modules matrix
- python scripts/modules-matrix.py > docs.it4i/modules-matrix.md
- bash scripts/clean_json.sh site/mkdocs/search_index.json
- sed -i 's,href="" title=",href="/" title=",g' site/404.html
# compress sitemap
- gzip < site/sitemap.xml > site/sitemap.xml.gz
shellcheck:
stage: test
image: davidhrbac/docker-shellcheck:latest
script:
- which shellcheck || apt-get update && apt-get install -y shellcheck
- find . -name *.sh -not -path "./docs.it4i/*" -not -path "./site/*" -exec shellcheck {} +
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
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- rsync -a --delete site/ root@"$SSH_HOST_STAGE":/srv/docs.it4i.cz/devel/$CI_BUILD_REF_NAME/
only:
- branches@it4i-admins/docs.it4i
deploy to production:
environment: production
stage: deploy
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
- rsync -a --delete site/ root@"$SSH_HOST_STAGE":/srv/docs.it4i.cz/site/