Commit 853439f8 authored by Andreas Böttger's avatar Andreas Böttger 😬
Browse files

Update .gitlab-ci.yml

parent 8458e218
variables:
COLON: ':'
stages:
- build
- 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
- 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:
# 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@fizban.rz.tu-harburg.de "mkdir -p /usr/share/nginx/html/review/$CI_BUILD_REF_NAME"
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r _book/* $SSH_USER@fizban.rz.tu-harburg.de:/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://fizban.rz.tu-harburg.de:56080/review/$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/$CI_PROJECT_PATH/$CI_COMMIT_REF_NAME/
on_stop: stop_review
only:
- branches
......@@ -33,16 +63,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@fizban.rz.tu-harburg.de "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
......@@ -50,7 +80,7 @@ stop_review:
- development
except:
- master
deploy:
stage: deploy
only:
......@@ -58,9 +88,11 @@ deploy:
tags:
- production
script:
- sshpass -p "$SSH_PASSWD" ssh -p "$SSH_PORT" $SSH_USER@fizban.rz.tu-harburg.de "mkdir -p /usr/share/nginx/html/production"
- sshpass -p "$SSH_PASSWD" scp -P "$SSH_PORT" -r _book/* $SSH_USER@fizban.rz.tu-harburg.de:/usr/share/nginx/html/production
- 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://fizban.rz.tu-harburg.de:56080/production/
when: manual
url: http://$HOST_NAME$COLON$HTTP_PORT/production/
#url: https://$PROXY_HOST_NAME/$CI_PROJECT_PATH/
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