Commit d54c2704 authored by MH's avatar MH

Merge branch '5-umstellung-auf-gitbook-container' into 'master'

Update .gitlab-ci.yml

Closes #5

See merge request !14
parents e4a8b6e0 f7f04051
Pipeline #8629 passed with stages
in 51 seconds
......@@ -6,32 +6,55 @@ 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
tags:
- development
script:
- gitbook install
- gitbook build
- gitbook pdf
- pwd
- 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_BUILD_NAME}_${CI_BUILD_REF_NAME}"
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
paths:
- book.pdf
# Was hier nicht gelistet ist, landet auch nicht in der `review`-Phase
- _book
- book_pdf
start_review:
stage: review
script:
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@$HOST_NAME "mkdir -p /usr/share/nginx/html/review/$CI_BUILD_REF_NAME"
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r _book/* $SSH_USER@$HOST_NAME:/usr/share/nginx/html/review/$CI_BUILD_REF_NAME
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@$HOST_NAME "mkdir -p /usr/share/nginx/html/review/$CI_COMMIT_REF_NAME"
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r _book/* $SSH_USER@$HOST_NAME:/usr/share/nginx/html/review/$CI_COMMIT_REF_NAME
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r book_pdf $SSH_USER@$HOST_NAME:/usr/share/nginx/html/review/${CI_COMMIT_REF_NAME}
environment:
name: review/$CI_BUILD_REF_NAME
#url: http://$HOST_NAME$COLON$HTTP_PORT/review/$CI_BUILD_REF_NAME/
url: https://$PROXY_HOST_NAME/reviews/$CI_PROJECT_PATH/$CI_BUILD_REF_NAME/
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:
- branches
......@@ -39,16 +62,16 @@ start_review:
- development
except:
- master
stop_review:
stage: review
variables:
GIT_STRATEGY: none
script:
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@$HOST_NAME "rm -rf /usr/share/nginx/html/review/$CI_BUILD_REF_NAME"
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@$HOST_NAME "rm -rf /usr/share/nginx/html/review/$CI_COMMIT_REF_NAME"
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
name: review/$CI_COMMIT_REF_NAME
action: stop
only:
- branches
......@@ -56,7 +79,7 @@ stop_review:
- development
except:
- master
deploy:
stage: deploy
only:
......@@ -64,9 +87,12 @@ deploy:
tags:
- production
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/$CI_PROJECT_PATH/
#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