Skip to content
Snippets Groups Projects
Verified Commit 21a2a6d5 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

remove old deployment scripts

parent 946f4fc6
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
DIRECTORY=build
# Install lunr to build the index
npm install lunr@2.3.8
# Go to the directory...
cd $DIRECTORY
printf "Found the following build targets inside: \n$(ls -d */)\n\n"
# ...and loop through all the build targets
for branch in $(ls -d */); do
echo "Entering: $branch";
cd "$branch";
echo "Generating the index..."
cat documents.js | node $CI_PROJECT_DIR/build_index.js > index.js
rm documents.js build_index.js
echo "...should be completed. First 50 characters of the index: "
cat index.js | head -c50
echo ""
cd ..
done
rm $CI_PROJECT_DIR/build_index.js
mkdir -p build
artefact="latest"
# loop through all the branches
for branch in $(git for-each-ref --format='%(refname:strip=3)' refs/remotes); do
echo $branch;
if [[ $branch == "master" ]]; then
artefact="stable";
elif [[ $branch == "develop" ]]; then
artefact="latest";
else
artefact="unstable";
fi
echo $artefact;
git checkout -f $branch
git reset --hard $branch
git pull
# Generate the config dynamically
echo 'url: "https://r3.pages.uni.lu"' > _config_url.yml
# build the website
bundle install
bundle exec jekyll build --config "_config.yml,_config_url.yml" --baseurl="howto-cards/$artefact" -d "build/$artefact"
if [[ $branch == "master" ]]; then
# set the 404
cp howto-cards/$artefact/404.html build/404.html
fi
done
# checkout the current branch
echo $CI_COMMIT_REF_NAME
git checkout -f $CI_COMMIT_REF_NAME
git reset --hard origin/$CI_COMMIT_REF_NAME
# set the auto redirection
cp .ci/.autoRedirect build/index.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment