Commit 0d15727e authored by Andreas Böttger's avatar Andreas Böttger 😬

Merge branch 'rztab' into 'master'

Update .gitlab-ci.yml

See merge request hoou/handcreme!23
parents cfc795b6 ffb0dfb7
image: docker.rz.tu-harburg.de:5000/docker/gitbook:node
image: docker.rz.tu-harburg.de:5000/rzt/images/gitbook:node
# https://docs.gitlab.com/ee/ci/yaml/README.html#exclude-jobs-with-rules-from-certain-pipelines
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
stages:
- setup
......@@ -41,8 +47,8 @@ test:
paths:
- node_modules
policy: pull
except:
- master
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
pdf:
stage: build
......@@ -76,8 +82,8 @@ pages:branches:
artifacts:
paths:
- _book
except:
- master
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
pages:master:
stage: build
......@@ -95,8 +101,8 @@ pages:master:
artifacts:
paths:
- _book
only:
- master
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
review:start:
stage: review
......@@ -115,8 +121,8 @@ review:start:
- _book
- book_pdf
policy: pull
except:
- master
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
environment:
name: $CI_COMMIT_REF_NAME
url: https://${REVIEW_PROXY_HOST_NAME}${REVIEW_BASE_DIR}~${CI_COMMIT_REF_NAME}/
......@@ -130,38 +136,36 @@ review:stop:
- eval $(ssh-agent -s)
- echo "$REVIEW_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh -p "${REVIEW_SSH_PORT}" "${REVIEW_SSH_USER}"@"${REVIEW_HOST_NAME}" "rm -rf /usr/share/nginx/html/~${CI_COMMIT_REF_NAME}"
when: manual
except:
- master
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
when: manual
allow_failure: true
environment:
name: $CI_COMMIT_REF_NAME
action: stop
deploy:
stage: deploy
only:
- master
except:
- schedules
script:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "mkdir -p /usr/share/nginx/html"
- scp -P "${SSH_PORT}" -r _book/* "${SSH_USER}"@"${HOST_NAME}":"/usr/share/nginx/html"
- if [ -d book_pdf ]; then ssh -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "mkdir -p /usr/share/nginx/html/book_pdf"; fi
- if [ -d book_pdf ]; then scp -P "${SSH_PORT}" -r book_pdf/* "${SSH_USER}"@"${HOST_NAME}":"/usr/share/nginx/html/book_pdf"; fi
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- _book
- book_pdf
policy: pull
environment:
name: $CI_COMMIT_REF_NAME
#url: https://$PROXY_HOST_NAME${BASE_DIR}
url: https://$PROXY_HOST_NAME/
stage: deploy
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
script:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "mkdir -p /usr/share/nginx/html"
- scp -P "${SSH_PORT}" -r _book/* "${SSH_USER}"@"${HOST_NAME}":"/usr/share/nginx/html"
- if [ -d book_pdf ]; then ssh -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "mkdir -p /usr/share/nginx/html/book_pdf"; fi
- if [ -d book_pdf ]; then scp -P "${SSH_PORT}" -r book_pdf/* "${SSH_USER}"@"${HOST_NAME}":"/usr/share/nginx/html/book_pdf"; fi
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- _book
- book_pdf
policy: pull
environment:
name: $CI_COMMIT_REF_NAME
url: https://$PROXY_HOST_NAME${BASE_DIR}
clean:
stage: clean
......@@ -171,32 +175,36 @@ clean:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "rm -rf /usr/share/nginx/html/*"
when: manual
only:
- master
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
when: manual
allow_failure: true
environment:
name: $CI_COMMIT_REF_NAME
action: stop
linkchecker:intern:
stage: linkchecker
except:
- master
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
when: manual
allow_failure: true
image:
name: linkchecker/linkchecker
entrypoint: [""]
script:
- linkchecker --recursion-level 10 --threads 10 --no-status --no-robots --no-warnings --ignore-url 'https://fonts.gstatic.com/{0,1}$' https://${REVIEW_PROXY_HOST_NAME}${REVIEW_BASE_DIR}~${CI_COMMIT_REF_NAME}/
when: manual
linkchecker:all:
stage: linkchecker
except:
- master
rules:
- if: '$CI_COMMIT_REF_NAME != "master"'
when: manual
allow_failure: true
image:
name: linkchecker/linkchecker
entrypoint: [""]
script:
- linkchecker --recursion-level 10 --threads 10 --no-status --no-robots --no-warnings --check-extern --ignore-url 'https://fonts.gstatic.com/{0,1}$' https://${REVIEW_PROXY_HOST_NAME}${REVIEW_BASE_DIR}~${CI_COMMIT_REF_NAME}/
when: manual
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment