Commit 3e80304a authored by Andreas Böttger's avatar Andreas Böttger 😬
Browse files

Update .gitlab-ci.yml

parent cb622584
Pipeline #8485 passed with stages
in 24 seconds
......@@ -6,7 +6,25 @@ stages:
- review
- deploy
build:
#pdfs:
# stage: build
# only:
# - branches
# tags:
# - development
# script:
# - pwd
# - sudo docker pull docker.rz.tu-harburg.de:5000/docker/pandoc4gitbook-glr:latest
# - sudo docker run --rm -v $(pwd):/source docker.rz.tu-harburg.de:5000/docker/pandoc4gitbook-glr
# - sudo docker pull docker.rz.tu-harburg.de:5000/docker/pandoc-glr:latest
# - mkdir -p book_pdf; sudo docker run --rm -v $(pwd):/source docker.rz.tu-harburg.de:5000/docker/pandoc-glr .pandoc-config.yml book.md -o book_pdf/pandocbook.pdf
# artifacts:
# name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
# paths:
# # Was hier nicht gelistet ist, landet auch nicht in der `review`-Phase
# - book_pdf
static_sites:
stage: build
only:
- branches
......@@ -14,11 +32,10 @@ build:
- development
script:
- pwd
- gitbook install
- gitbook build
# Quick and dirty hack: The creation of the PDF document does not always work. This seems to be a bug.
- mkdir -p book_pdf; until gitbook pdf ./ ./book_pdf/book.pdf; do printf "$s\n" "failure, next try …"; done
- sudo docker pull docker.rz.tu-harburg.de:5000/docker/gitbook-glr:latest
- sudo docker run --rm -v $(pwd):/source docker.rz.tu-harburg.de:5000/docker/gitbook-glr install
- sudo docker run --rm -v $(pwd):/source docker.rz.tu-harburg.de:5000/docker/gitbook-glr build
- mkdir -p book_pdf; sudo docker run --rm -v $(pwd):/source docker.rz.tu-harburg.de:5000/docker/gitbook-glr pdf ./ ./book_pdf/book.pdf
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
paths:
......@@ -26,7 +43,7 @@ build:
- _book
- book_pdf
start_review:
stage: review
script:
......@@ -36,6 +53,7 @@ start_review:
environment:
name: review/$CI_COMMIT_REF_NAME
url: http://$HOST_NAME$COLON$HTTP_PORT/review/$CI_COMMIT_REF_NAME/
#url: https://$PROXY_HOST_NAME/reviews/$BASE_PATH/$CI_COMMIT_REF_NAME/
#url: https://$PROXY_HOST_NAME/reviews/$CI_PROJECT_PATH/$CI_COMMIT_REF_NAME/
on_stop: stop_review
only:
......@@ -44,7 +62,7 @@ start_review:
- development
except:
- master
stop_review:
stage: review
variables:
......@@ -61,17 +79,20 @@ stop_review:
- development
except:
- master
deploy:
stage: deploy
only:
- master
tags:
- production
script:
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@$HOST_NAME "mkdir -p /usr/share/nginx/html/production"
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r _book/* $SSH_USER@$HOST_NAME:/usr/share/nginx/html/production
environment:
name: production
url: http://$HOST_NAME$COLON$HTTP_PORT/production/
#url: https://fizban05.rz.tu-harburg.de/$CI_PROJECT_PATH/
\ No newline at end of file
script:
- pwd
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@$HOST_NAME "mkdir -p /usr/share/nginx/html/production"
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r _book/* $SSH_USER@$HOST_NAME:/usr/share/nginx/html/production
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r book_pdf $SSH_USER@$HOST_NAME:/usr/share/nginx/html/production
environment:
name: production
url: http://$HOST_NAME$COLON$HTTP_PORT/production/
#url: https://$PROXY_HOST_NAME/$BASE_PATH/
#url: https://$PROXY_HOST_NAME/$CI_PROJECT_PATH/
\ No newline at end of file
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