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

Update .gitlab-ci.yml file

parent 96badc57
No related branches found
No related tags found
No related merge requests found
Pipeline #255379 canceled
...@@ -13,6 +13,10 @@ variables: ...@@ -13,6 +13,10 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: 0 GIT_DEPTH: 0
.default_rules:
rules:
- if: $IS_NEW_VERSION_REQUIRED
check_current_version: check_current_version:
before_script: before_script:
- apk add html-xml-utils curl jq - apk add html-xml-utils curl jq
...@@ -20,10 +24,15 @@ check_current_version: ...@@ -20,10 +24,15 @@ check_current_version:
script: script:
- echo https://$HOSTING_HOST - echo https://$HOSTING_HOST
- 'export CSITE_VERSION=$(curl -s https://${HOSTING_HOST} | hxnormalize -xe | hxselect -c "script#__config" | hxuncdata | jq -r .version)' - 'export CSITE_VERSION=$(curl -s https://${HOSTING_HOST} | hxnormalize -xe | hxselect -c "script#__config" | hxuncdata | jq -r .version)'
- echo "Found site version $CSITE_VERSION" - 'export IS_NEW_VERSION_REQUIRED=$([[ "$CSITE_VERSION" == "$CI_COMMIT_SHORT_SHA" ]] && echo "false" || echo "true")'
- '[[ "$CSITE_VERSION" != "$CI_COMMIT_SHORT_SHA" ]]' - echo "Found site version $CSITE_VERSION therefore NEW VERSION IS REQUIRED $IS_NEW_VERSION_REQUIRED"
- echo "CURRENT_SITE_VERSION=$CSITE_VERSION" >> version.env
- echo "IS_NEW_VERSION_REQUIRED=$IS_NEW_VERSION_REQUIRED" >> version.env
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
artifacts:
reports:
dotenv: version.env
docs: docs:
stage: test stage: test
...@@ -31,6 +40,8 @@ docs: ...@@ -31,6 +40,8 @@ docs:
allow_failure: true allow_failure: true
script: script:
- mdl -r ~MD013,~MD010,~MD014,~MD024,~MD026,~MD029,~MD033,~MD036,~MD037,~MD046 *.md main/ topics/ # BUGS - mdl -r ~MD013,~MD010,~MD014,~MD024,~MD026,~MD029,~MD033,~MD036,~MD037,~MD046 *.md main/ topics/ # BUGS
rules:
- !reference [.default_rules, rules]
# pylint: # pylint:
# stage: test # stage: test
...@@ -55,6 +66,8 @@ capitalize: ...@@ -55,6 +66,8 @@ capitalize:
allow_failure: true allow_failure: true
script: script:
- find mkdocs.yml topics/ main/ \( -name '*.md' -o -name '*.yml' \) -print0 | xargs -0 -n1 scripts/titlemd.py --test - find mkdocs.yml topics/ main/ \( -name '*.md' -o -name '*.yml' \) -print0 | xargs -0 -n1 scripts/titlemd.py --test
rules:
- !reference [.default_rules, rules]
ext_links: ext_links:
stage: after_test stage: after_test
...@@ -65,6 +78,8 @@ ext_links: ...@@ -65,6 +78,8 @@ ext_links:
- rm *.json - rm *.json
script: script:
- find topics/ main/ -name '*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect - find topics/ main/ -name '*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
rules:
- !reference [.default_rules, rules]
404s: 404s:
stage: after_test stage: after_test
...@@ -80,6 +95,7 @@ ext_links: ...@@ -80,6 +95,7 @@ ext_links:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: never when: never
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
- !reference [.default_rules, rules]
# mkdocs: # mkdocs:
# stage: build # stage: build
...@@ -148,6 +164,7 @@ docker-build: ...@@ -148,6 +164,7 @@ docker-build:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
exists: exists:
- Dockerfile - Dockerfile
- !reference [.default_rules, rules]
.mkdocs-build: &mkdocs-build .mkdocs-build: &mkdocs-build
stage: build stage: build
...@@ -167,8 +184,9 @@ mkdocs: ...@@ -167,8 +184,9 @@ mkdocs:
name: "${CI_REGISTRY_IMAGE}:latest" name: "${CI_REGISTRY_IMAGE}:latest"
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
<<: *mkdocs-build <<: *mkdocs-build
only: rules:
- master - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- !reference [.default_rules, rules]
mkdocs-dev: mkdocs-dev:
image: image:
...@@ -198,9 +216,10 @@ deploy production: ...@@ -198,9 +216,10 @@ deploy production:
url: https://${HOSTING_HOST} url: https://${HOSTING_HOST}
script: script:
- rsync -a -e "ssh -o StrictHostKeyChecking=no" --delete --exclude=/review site/ ${HOSTING_USERNAME}@${HOSTING_HOST}:~/public_html - rsync -a -e "ssh -o StrictHostKeyChecking=no" --delete --exclude=/review site/ ${HOSTING_USERNAME}@${HOSTING_HOST}:~/public_html
only:
- master
<<: *prepare_deploy <<: *prepare_deploy
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- !reference [.default_rules, rules]
deploy dev: deploy dev:
needs: ["mkdocs-dev"] needs: ["mkdocs-dev"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment