Skip to content
Snippets Groups Projects
Commit f21fe955 authored by Michelle Weidling's avatar Michelle Weidling :blowfish:
Browse files

docs: add docs for CI scripts

parent 71479c1e
Branches
No related tags found
1 merge request!18Feature/#45 ci add docs
Pipeline #202602 passed
......@@ -8,6 +8,7 @@ PROJECT_ID=14957
ACTIVE_BRANCHES=$(curl --header "PRIVATE-TOKEN: $API_TOKEN" "https://gitlab.gwdg.de/api/v4/projects/${PROJECT_ID}/repository/branches" | jq '.[].name')
ACTIVE_BRANCHES=$(echo $ACTIVE_BRANCHES | sed -E "s/[^0-9a-z[:space:]\"]/-/g")
# get environments
ENVIRONMENTS=$(curl --header "PRIVATE-TOKEN: $API_TOKEN" "https://gitlab.gwdg.de/api/v4/projects/${PROJECT_ID}/environments")
ENV_NAMES=$(echo $ENVIRONMENTS | jq -r '.[].name')
......
#!/bin/bash
# This script removes all data that belongs to branches that have been closed.
# This way we ensure that the artifacts don't get too big.
PROJECT_ID=14957
# get active branches
......
#!/bin/bash
# This script sets the base path for vuepress according to the branch we're on.
# Since our environments always have their respective branch name in the URL,
# the base path has to be adjusted to that. Otherwise the files of the environment
# will not be found.
if [[ $1 == "main" ]]; then
sed -i "s|base:\s*'/'|base: '/ahiqar/website/'|" src/.vuepress/config.js
else
......
#!/bin/bash
# This script gets the old artifacts containing the data for all active environments and
# adds the current branch's data to them.
# This way we can preserve the old environments and have the new one, too.
DIST_DIR=src/.vuepress/dist
PROJECT_ID=14957
......@@ -14,7 +18,8 @@ unzip -u old-artifact.zip
# we want the main branch to be available at https://subugoe.pages.gwdg.de/ahiqar/website/ while
# the environments of the feature branches should be available at
# https://subugoe.pages.gwdg.de/ahiqar/website/${CI_COMMIT_REF_SLUG}/
# https://subugoe.pages.gwdg.de/ahiqar/website/${CI_COMMIT_REF_SLUG}/.
# this has to be considered in the directory structure.
if [ ! ${CI_COMMIT_REF_SLUG} = 'main' ]; then
mkdir -p public/${CI_COMMIT_REF_SLUG}
cp --recursive ${DIST_DIR}/* public/${CI_COMMIT_REF_SLUG}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment