README.md 2.69 KB
Newer Older
Jacek Lebioda's avatar
Jacek Lebioda committed
1 2
# R3-pages
This is a repository containing source for the index pages of [http://r3lab.uni.lu/](http://r3lab.uni.lu/) and its frozen pages.
Christophe Trefois's avatar
Christophe Trefois committed
3

Jacek Lebioda's avatar
Jacek Lebioda committed
4 5 6 7
Note that the sites from _Websites_ menu tab, are contained in their own repositories:
  * TGM-pipeline at [https://git-r3lab.uni.lu/core-services/r3lab/tgm-pipeline-doc]()
  * CASian at [https://git-r3lab.uni.lu/core-services/r3lab/casian-doc](https://git-r3lab.uni.lu/core-services/r3lab/casian-doc)
  * IMP at [https://git-r3lab.uni.lu/core-services/r3lab/imp-doc](https://git-r3lab.uni.lu/core-services/r3lab/imp-doc)
Christophe Trefois's avatar
Christophe Trefois committed
8

Jacek Lebioda's avatar
Jacek Lebioda committed
9 10 11
# Deployment
## How are the pages built?
All of these pages are built with Jekyll using Gitlab-CI (see respective `.gitlab-ci.yml` files and the instructions on [https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-default](https://git-r3lab.uni.lu/core-services/jekyll-theme-lcsb-default)` if you need more information).
Christophe Trefois's avatar
Christophe Trefois committed
12

Jacek Lebioda's avatar
Jacek Lebioda committed
13 14
## How are the pages uploaded to the VM?
There is `deploy to production` section in `.gitlab-ci.yml`, which pushes the built webpage onto the VM. Under the hood, there are details saved in [Settings ==> CI/CD ==> Variables](https://git-r3lab.uni.lu/core-services/r3lab/r3-pages/-/settings/ci_cd) section, which comprise the secret values (SSH key, the username, VM address etc.). If you create a new page which should upload the page there, don't forget to add those!
Christophe Trefois's avatar
Christophe Trefois committed
15

Jacek Lebioda's avatar
Jacek Lebioda committed
16 17
## How are the pages published?
At current moment, the staticpages VM is configured to expose files from `/home/r3pages/web/latest` under `r3lab.uni.lu`.
Christophe Trefois's avatar
Christophe Trefois committed
18

Jacek Lebioda's avatar
Jacek Lebioda committed
19 20
  * the index page goes into `~/web/web_$CI_TASK_ID` (e.g. `~/web/web_115885`) and then it gets soft-symlinked into `~/web/latest`.
  * the other pages go into `~/web/$PROJECT_NAME_$CI_TASK_ID` (e.g. `~/web/casian-doc_115903`), and then it gets soft-symlinked into `~/web/latest/web/$PROJECT_NAME`, e.g. `~/web/latest/web/casian-doc`.
Christophe Trefois's avatar
Christophe Trefois committed
21 22


Jacek Lebioda's avatar
Jacek Lebioda committed
23 24
# First-time deployment
Don't forget to create the directories! (including `~/web/latest`)
Jacek Lebioda's avatar
Jacek Lebioda committed
25 26

```
Jacek Lebioda's avatar
Jacek Lebioda committed
27
mkdir -p ~/web/latest/web/casian-doc ~/web/latest/web/imp-doc ~/web/latest/web/tgm-pipeline
Jacek Lebioda's avatar
Jacek Lebioda committed
28 29
```

Jacek Lebioda's avatar
Jacek Lebioda committed
30
# Emergency recovery
Jacek Lebioda's avatar
Jacek Lebioda committed
31

Jacek Lebioda's avatar
Jacek Lebioda committed
32 33 34 35 36
## Elegant solution
  1. SSH into the VM, and remove all the old files `cd ~/web; rm -rf *`
  2. Recreate the folder structure with `mkdir -p ~/web/latest/web/casian-doc ~/web/latest/web/imp-doc ~/web/latest/web/tgm-pipeline`
  3. Go into r3-pages repository, and schedule CI/CD execution with `Run pipeline` -> master
  4. Go into respective pages repositories, and schedule their CI/CD execution with `Run pipeline` -> master
Christophe Trefois's avatar
Christophe Trefois committed
37

Jacek Lebioda's avatar
Jacek Lebioda committed
38 39
## Faster solution
There is a weekly backup, you might want to recover from it. The location of backups is in the `~/backups` directory.
Christophe Trefois's avatar
Christophe Trefois committed
40

Jacek Lebioda's avatar
Jacek Lebioda committed
41 42
  1. SSH into the VM, and remove all the old files `cd ~/web; rm -rf *`
  2. Unpack selected backup into `~/web/latest/`