Skip to content
Snippets Groups Projects
Verified Commit b8701c24 authored by Martin Weise's avatar Martin Weise
Browse files

Updated cache

parent 8c632d15
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
OVERRIDES_MAIN_HTML="" OVERRIDES_MAIN_HTML=""
SCRIPTS_EXTRA_JS="" SCRIPTS_EXTRA_JS=""
function clean_cache {
echo "Removing cache from directory ./site"
rm -rf ./site
}
function generate_docs { function generate_docs {
BRANCH="release-$1" BRANCH="release-$1"
echo "===================================================" echo "==================================================="
echo "Removing cache from directory ./site"
rm -rf ./site
echo "Building DOCS for version $1 on branch $BRANCH" echo "Building DOCS for version $1 on branch $BRANCH"
echo "===================================================" echo "==================================================="
git reset --hard && git checkout "$BRANCH" git reset --hard && git checkout "$BRANCH"
...@@ -26,13 +29,12 @@ function generate_docs { ...@@ -26,13 +29,12 @@ function generate_docs {
find .docs/ -type f -exec sed -i -e "s/__CHARTVERSION__/$1/g" {} \; find .docs/ -type f -exec sed -i -e "s/__CHARTVERSION__/$1/g" {} \;
mkdocs build > /dev/null && cp -r ./site "./final/$1" mkdocs build > /dev/null && cp -r ./site "./final/$1"
cp -r "./swagger/$1" "./final/$1/swagger" cp -r "./swagger/$1" "./final/$1/swagger"
clean_cache
} }
function generate_api { function generate_api {
BRANCH="release-$1" BRANCH="release-$1"
echo "===================================================" echo "==================================================="
echo "Removing cache from directory ./site"
rm -rf ./site
echo "Building API for version $1 on branch $BRANCH" echo "Building API for version $1 on branch $BRANCH"
echo "===================================================" echo "==================================================="
git reset --hard && git checkout "$BRANCH" git reset --hard && git checkout "$BRANCH"
...@@ -40,6 +42,7 @@ function generate_api { ...@@ -40,6 +42,7 @@ function generate_api {
find ./site -type f -exec sed -i -e "s/__APPVERSION__/$1/g" {} \; find ./site -type f -exec sed -i -e "s/__APPVERSION__/$1/g" {} \;
mkdir -p "./swagger/$1" mkdir -p "./swagger/$1"
cp -r ./site/* "./swagger/$1/" cp -r ./site/* "./swagger/$1/"
clean_cache
} }
# usage # usage
...@@ -76,4 +79,6 @@ done ...@@ -76,4 +79,6 @@ done
echo "===================================================" echo "==================================================="
echo "Moving default version $APP_VERSION docs to /" echo "Moving default version $APP_VERSION docs to /"
cp -r ./final/${APP_VERSION}/* ./final/ cp -r ./final/${APP_VERSION}/* ./final/
echo "Compress final documentation"
tar czfv final.tar.gz ./final
echo "===================================================" echo "==================================================="
...@@ -470,7 +470,7 @@ stages: ...@@ -470,7 +470,7 @@ stages:
# - python3 .docs/docker/release.py # - python3 .docs/docker/release.py
docs-docs: docs-docs:
stage: release stage: docs
image: docker.io/python:3.11-slim image: docker.io/python:3.11-slim
only: only:
refs: refs:
...@@ -480,12 +480,12 @@ docs-docs: ...@@ -480,12 +480,12 @@ docs-docs:
- make docs - make docs
cache: cache:
paths: paths:
- ./final - ./final.tar.gz
artifacts: artifacts:
when: always when: always
paths: paths:
- ./final - ./final.tar.gz
expire_in: 1 days expire_in: 1 hour
release-images: release-images:
stage: release stage: release
...@@ -535,6 +535,5 @@ release-docs: ...@@ -535,6 +535,5 @@ release-docs:
- echo "$CI_KEY_PRIVATE" > /root/.ssh/id_rsa && chmod 0600 /root/.ssh/id_rsa - echo "$CI_KEY_PRIVATE" > /root/.ssh/id_rsa && chmod 0600 /root/.ssh/id_rsa
- echo "$CI_KEY_PUBLIC" > /root/.ssh/id_rsa.pub - echo "$CI_KEY_PUBLIC" > /root/.ssh/id_rsa.pub
- echo "$CI_DOC_ID" > ~/.ssh/known_hosts - echo "$CI_DOC_ID" > ~/.ssh/known_hosts
- tar czfv final.tar.gz ./final
- "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa final.tar.gz $CI_DOC_USER@$CI_DOC_IP:final.tar.gz" - "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa final.tar.gz $CI_DOC_USER@$CI_DOC_IP:final.tar.gz"
- "ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa $CI_DOC_USER@$CI_DOC_IP 'rm -rf /system/user/ifs/infrastructures/public_html/dbrepo/*; tar xzfv ./final.tar.gz; rm -f ./final.tar.gz; cp -r ./final/* /system/user/ifs/infrastructures/public_html/dbrepo; rm -rf ./final'" - "ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa $CI_DOC_USER@$CI_DOC_IP 'rm -rf /system/user/ifs/infrastructures/public_html/dbrepo/*; tar xzfv ./final.tar.gz; rm -f ./final.tar.gz; cp -r ./final/* /system/user/ifs/infrastructures/public_html/dbrepo; rm -rf ./final'"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment