Skip to content
Snippets Groups Projects
Commit 42c7acdc authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !129
parents 2ad018db 598f1359
No related branches found
No related tags found
5 merge requests!245Integrate data upload cloud,!235Integrate data upload cloud,!224Fixing a couple of issues in the redesign,!167Access harrenhal,!129Develop
Pipeline #24333 passed
url: "https://howto-latest.lcsb.uni.lu"
baseurl: "/"
url: "https://howto.lcsb.uni.lu"
baseurl: "/"
url: "https://r3.pages.uni.lu"
#!/bin/bash
# Install lunr to build the index
npm install lunr@$LUNR_VERSION
# Go to the directory containing the built website...
cd $DIRECTORY
echo "Generating the index..."
# Pipe documents.js file (which should be generated by Jekyll after building the website) through build script
cat documents.js | node build_index.js > index.js
# Show the results (should not be empty)
echo "...should be completed. First 50 characters of the index: "
cat index.js | head -c50
echo ""
rm documents.js build_index.js
......@@ -16,9 +16,12 @@ for branch in $(git for-each-ref --format='%(refname:strip=3)' refs/remotes); do
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 --baseurl="howto-cards/$artefact" -d "build/$artefact"
bundle exec jekyll build --config "_config.yml,_config_url.yml" --baseurl="howto-cards/$artefact" -d "build/$artefact"
if [[ $branch == "master" ]]; then
# set the 404
......
......@@ -6,6 +6,16 @@ stages:
- generate_index
- deploy
# !!!!!!! README !!!!!
# We are in the transition period - and the website is deployed two times - to gitlab pages and to a separate VM
# In order to migrate to a new deployment:
# 1) remove "Old deployment" section - build_pages, generate the search index and pages tasks
# 2) rename "new pages" to "pages" in the new deployment section, and "new_public" to "public"; you might also rename directories (skip "new" part)
# 3) remove ".ci/deploy.sh", ".ci/build_indices.sh"
# Old deployment =================================================================
build_pages:
stage: build
before_script:
......@@ -48,3 +58,80 @@ pages:
expire_in: 1 week
paths:
- public
# New deployment ==================================================================
build pages for VM deployment:
stage: build
variables:
JEKYLL_ENV: production
BUNDLER_VERSION: 2.0.2
artifacts:
expire_in: 1 day
paths:
- new_build
before_script:
- gem install bundler:$BUNDLER_VERSION && bundle install
script:
# Generate the configuration for forks (will use Gitlab Pages on personal namespaces)
- 'echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> .ci/_config_gitlab_pages.yml'
- 'echo "baseurl: /$CI_PROJECT_NAME" >> .ci/_config_gitlab_pages.yml'
# If there is no config for the current branch, use the one for Gitlab Pages
- 'if [ ! -f ".ci/_config_$CI_COMMIT_REF_NAME.yml" ]; then mv .ci/_config_gitlab_pages.yml .ci/_config_$CI_COMMIT_REF_NAME.yml; fi'
# Display, which configuration is used
- 'echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"'
# Run Jekyll with custom configuration
- bundle exec jekyll build -d new_build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml"
generate the search index for VM deployment:
stage: generate_index
image: node:13.8.0-slim
variables:
LUNR_VERSION: 2.3.8
DIRECTORY: new_build
script:
- bash .ci/build_indices_new.sh
- mv new_build new_processed_build
artifacts:
expire_in: 1 day
paths:
- new_processed_build
# Deploy to Gitlab Pages - to be run only by forks; change to pages once it's ready
new pages:
image: alpine:3.11.3
stage: deploy
rules:
- if: '$CI_PROJECT_NAMESPACE != "R3" && $CI_PROJECT_NAMESPACE != "R3-core"'
script:
- mv new_processed_build new_public
artifacts:
expire_in: 1 week
paths:
- new_public
## Deploys the website to a separate VM
deploy to production:
stage: deploy
image: alpine:3.1
before_script:
- 'which ssh-agent || ( apk add --update openssh )'
- eval $(ssh-agent -s)
- echo "$B64SSHPRIVKEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- 'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo "$KNOWNHOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
rules:
- if: '$CI_COMMIT_BRANCH == "develop" && $CI_PROJECT_PATH == "R3/howto-cards"'
- if: '$CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "R3/howto-cards"'
script:
- ssh -p $SSHPORT $SSHCONNECT "mkdir -p ~/$CI_COMMIT_BRANCH/sources/public/$CI_JOB_ID ~/$CI_COMMIT_BRANCH/public"
- scp -P $SSHPORT -r new_processed_build/* $SSHCONNECT:~/$CI_COMMIT_BRANCH/sources/public/$CI_JOB_ID
- ssh -p $SSHPORT $SSHCONNECT "cd ~/$CI_COMMIT_BRANCH/public && ln -fs ../sources/public/$CI_JOB_ID/* . && cd ~/$CI_COMMIT_BRANCH/sources/public/ && find . -type d -not -newermt '-1 minutes' -exec rm -rf {} +;"
......@@ -27,6 +27,9 @@ group :jekyll_plugins do
gem "jekyll-feed",
"~> 0.6"
gem 'jekyll-email-protect',
"~> 1.1"
gem 'jekyll-theme-lcsb-frozen-components',
'~> 0.0.2',
:git => "https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-frozen-components.git",
......
......@@ -19,8 +19,8 @@ description: >- # this means to ignore newlines until "baseurl:"
This page is an index for lab cards that are intended to provide practical guidance in implementing Data Management, Data Protection and IT setup.
# URL settings (the most difficult part, please refer to the guide)
baseurl: "/howto-cards" # the subpath of your site, e.g. /gitlab-repository-name
url: "https://r3.pages.uni.lu" # the base hostname & protocol for your site, e.g. http://gitlab-namespace-name.pages.uni.lu/
baseurl: "/" # the subpath of your site, e.g. /gitlab-repository-name
url: "https://localhost" # the base hostname & protocol for your site, e.g. http://gitlab-namespace-name.pages.uni.lu/
# Banner settings
banner: howto-card # When you have custom images, change this setting's value to the name of the folder containing them
......@@ -62,6 +62,8 @@ plugins:
# The display logic itself is in the template
share_url: https://howto.lcsb.uni.lu/?
include_link_index: 4
# These values are injected into cards
defaults:
-
scope:
......
Jekyll::Hooks.register([:pages, :posts, :documents], :pre_render) do |post|
# This will run every time the website is built
# Include a plugin (needs to be in gemfile)
include Jekyll::EmailProtect::EmailProtectionFilter
# Using a simpler version of email regexp
email_regexp = /mailto\:(?:[\'\"]*)(?:[\w+\-]\.?)+@[a-z\d\-]+(?:\.[a-z]+)*\.[a-z]+(?:[\'\"]*)/i
# Take post's content, and transform every occurence of the following regexp (an email)
post.content = post.content.gsub(email_regexp) {
# For every occurence, apply protection function:
|param| "mailto:" + Jekyll::EmailProtect::EmailProtectionFilter::encode_email(param[7..-1].delete("'").delete('"'))
}
end
......@@ -7,7 +7,4 @@ order: 3
If you need help, please create a request for support by creating a ticket on [ServiceNow](https://service.uni.lu/) using the catalog item _LCSB/BioCore: Application Services_.
If you don't have access to service now, please contact us using <span id="obf"><noscript><span style="unicode-bidi:bidi-override;direction:rtl;">ul.inu@snimdasys-bscl</span></noscript></span>.
<script>document.getElementById("obf").innerHTML="<n uers=\"znvygb:ypfo-flfnqzvaf@hav.yh?fhowrpg=[ynoPneqf] Freivpr erdhrfg\" gnetrg=\"_oynax\">guvf rznvy</n>".replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});document.body.appendChild(eo);</script>
\ No newline at end of file
If you don’t have access to service now, please contact us using [this email](mailto:lcsb-sysadmins@uni.lu?subject=[How-to cards]%20Service%20request).
\ No newline at end of file
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