From 3448fc57855ad7536a49397b628aa7a2d8afde3b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 24 Jun 2024 12:23:51 -0400 Subject: [PATCH] gitlab-ci: fix test preview feature --- .gitlab-ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7447951..5c13bdb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,16 +26,12 @@ pages: fi - rm -rf public/$CURRENT_CONTENT_PATH || true # remove last version of current branch script: + - | # sed needs to be in its own section + sed -i "s|destdir.*|destdir: ./public/$CURRENT_CONTENT_PATH|" ikiwiki.setup - ikiwiki --setup ikiwiki.setup - | # create symbolic link to index.en.html if public/index.html does not exist - if [ ! -L "public/index.html" ]; then - ln -s index.en.html public/index.html - fi - - | - if [ -z "$CURRENT_CONTENT_PATH" ]; then - mv public output - mkdir -p public - mv public public/$CURRENT_CONTENT_PATH + if [ ! -L "public/$CURRENT_CONTENT_PATH/index.html" ]; then + ln -s index.en.html public/$CURRENT_CONTENT_PATH/index.html fi - cd public/$EPHEMERAL_BRANCHES_PATH - tree -d -H '.' -L 1 --noreport --charset utf-8 -T "Versions" -o index.html # generate a root HTML listing all previews for easier access