Commit 1042c0cc authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

Merge branch 'develop' into 'master'

Regular merge of develop

See merge request R3/outreach/templates/presentation!1
parents 900d9c88 05990371
#!/bin/bash
PAGEURL="https://r3.pages.uni.lu/templates/outreach/presentation"
rootDir=$(pwd)
echo $rootDir
# clean previous builds
rm -rf $rootDir/public
mkdir $rootDir/public
# loop through all the presentations
nBlades=0
for d in $(find . -maxdepth 1 -type d)
do
if [[ "${d}" == *20* ]]; then
cd "${d}"
echo "changed to ${d}"
for d1 in $(find . -maxdepth 1 -type d)
do
if [[ ${#d1} -ge 2 ]]; then
let "nBlades+=1"
#blades[$nBlades]="$tutorial"
BLADE=${d1:2}
echo " > -----------------------------------------------------"
echo "Building ... ${d1}"
# create the required folders in public
mkdir $rootDir/public/$BLADE
mkdir $rootDir/public/$BLADE/unstable
mkdir $rootDir/public/$BLADE/latest
mkdir $rootDir/public/$BLADE/stable
# change to the blade directory to be built
cd $BLADE
# build the unstable version - can be optimized
git config submodule.theme.url https://$CI_DEPLOY_USER:$CI_DEPLOY_PASSWORD@git-r3lab.uni.lu/R3-core/outreach/theme.git
git submodule update --recursive --init
# run contribute
cp ../../template/Gruntfile.coffee .
ln -s ../../theme/package.json package.json
ln -s ../../theme theme
# install npm
#npm install -g npm@latest yo grunt-cli generator-reveal
#npm install
yarn global add grunt-cli generator-reveal
yarn install
grunt dist
mv public/* $rootDir/public/$BLADE/unstable/.
echo " > unstable built for file set ${BLADE}"
# build the master version into stable
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git stash
git checkout $latestTag
git submodule update --init
grunt dist
mv public/* $rootDir/public/$BLADE/stable/.
echo " > stable built for file set ${BLADE}"
# build the develop version into latest
git stash
git checkout -f develop
git fetch origin develop
git reset --hard origin/develop
git submodule update --init
grunt dist
mv public/* $rootDir/public/$BLADE/latest/.
echo " > latest built for file set ${BLADE}"
# auto redirect file to the stable version
echo '<html>\n
<head>\n
<meta http-equiv="refresh" content="0; url='$PAGEURL'/'$BLADE'/stable"/>\n
</head>\n
<body>\n
</bod>\n
</html>\n' > $rootDir/public/$BLADE/index.html
echo "autoredirect file set"
# move back out
cd ..
echo " > -----------------------------------------------------"
fi
done
fi
done
image: git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt
pages:
stage: deploy
script:
- bash .ci/deploy.sh
artifacts:
expire_in: 1 week
paths:
- public
index.html
package-lock.json
dist/
public/
node_modules/
dist
*.log
.sass-cache
.grunt
.DS_Store
yarn.lock
stable/
latest/
Gruntfile.coffee
!template/Gruntfile.coffee
package.json
!template/package.json
20*/*/theme
!./theme
./theme/package.json
__pycache__/
contribute.egg-info/
......@@ -13,8 +13,7 @@ $ git clone --recurse-submodules ssh://git@git-r3lab-server.uni.lu:8022/R3/outre
Then, run:
```
$ ./contribute.sh -date "YYYY-MM-DD" -name "presentationName"
```bash
$ ./contribute.sh -d YYYY-MM-DD -n presentationName
```
Your slides are now in `YYYY/YYYY-MM-DD_presentationName/slides`.
......@@ -30,67 +29,9 @@ $ ./contribute.sh -d 2019-12-25 -n xmas
```
The slides are in `2019/2019-12-25_xmas/slides`.
# Local method
## Prerequisites
In order to use the slide deck, you must have:
- **git**: For convenience, have your SSH key configured on git-r3lab. [Here](https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html) is how to do it.
- **git-lfs**: Installation instructions are [here](https://help.github.com/en/articles/installing-git-large-file-storage)
- **Python 3**: It is recommend to use a virtual environment. Information on how to create a virtual environment is [here](https://virtualenvwrapper.readthedocs.io/en/latest/).
- **yarn**: Instructions are [here](https://yarnpkg.com/lang/en/docs/install)
## How to get started
- Fork this repository
- Clone your fork
```bash
$ git clone --recurse-submodules ssh://git@git-r3lab-server.uni.lu:8022/<yourUsername>/presentations-internal.git
```
- If the `--recurse-submodules` flag has been omitted, run this command to check for the missing modules and update them:
```bash
$ git submodule update --init --recursive
```
- Open a terminal and work on your presentation:
```bash
$ cd presentations-internal
$ pip install .
$ contribute --date="YYYY-MM-DD" --name="yourAwesomeTitle"
```
## <img src="https://webdav-r3lab.uni.lu/public/R3lab/logos/warning.png" height="20px" width="20px"> Tips
- Please create a branch from `develop` before starting to work on your presentation. You could name it `YYYY-MM-DD_yourAwesomeTitle`.
- If you are done with making changes to your presentation, push them to your fork and open a merge request against the `develop` branch.
## <img src="https://webdav-r3lab.uni.lu/public/R3lab/logos/warning.png" height="20px" width="20px">Solving the error: `Fatal error: Unable to find local grunt.`
If you get a fatal error complaining about your local grunt installation, please make sure that you have add the `--recurse-submodules` flag when cloning, or that you ran the `git submodule update --init --recursive` command from within
the `presentations-internal` directory.
Please also make sure that you run the `contribute` command from the root of the `presentations-internal` directory.
## How to continue working on a presentation
For resuming your work on a presentation, you can either run the same contribute command:</br>
```
$ contribute --date="YYYY-MM-DD" --name="yourAwesomeTitle"
```
or you can navigate to your presentation directory and start `grunt` server:
```
$ cd YYYY/yourAwesomeTitle/
$ grunt server
```
## Adding a new slide/slides
Create a Markdown file with your slide(s) in `YYYY-MM-DD_yourAwesomeTitle/slides` and place it into `list.md` file at desired position:
Create a JSON file with your slide(s) in `YYYY-MM-DD_presentationName/slides` and place it into `list.json` file at desired position:
```
[
{ "filename": "index.md" },
......@@ -99,3 +40,10 @@ Please also make sure that you run the `contribute` command from the root of the
{ "filename": "thanks.md" }
]
```
## How to continue working on a presentation
For resuming your work on a presentation, you can run the same contribute command:</br>
```bash
$ ./contribute.sh -d YYYY-MM-DD -n presentationName
```
\ No newline at end of file
......@@ -20,6 +20,10 @@ def main(date, name):
# get the root directory
rootDir = os.getcwd()
# create a root directory if not existing
if not os.path.exists(mainDir):
os.mkdir(mainDir)
# generate the full name of the presentation
fullName = date + "_" + name
......
# Local method
## Prerequisites
In order to use the slide deck, you must have:
- **git**: For convenience, have your SSH key configured on git-r3lab. [Here](https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html) is how to do it.
- **git-lfs**: Installation instructions are [here](https://help.github.com/en/articles/installing-git-large-file-storage)
- **Python 3**: It is recommend to use a virtual environment. Information on how to create a virtual environment is [here](https://virtualenvwrapper.readthedocs.io/en/latest/).
- **yarn**: Instructions are [here](https://yarnpkg.com/lang/en/docs/install)
## How to get started
- Fork this repository
- Clone your fork
```bash
$ git clone --recurse-submodules ssh://git@git-r3lab-server.uni.lu:8022/<yourUsername>/presentations-internal.git
```
- If the `--recurse-submodules` flag has been omitted, run this command to check for the missing modules and update them:
```bash
$ git submodule update --init --recursive
```
- Open a terminal and work on your presentation:
```bash
$ cd presentations-internal
$ pip install .
$ contribute --date="YYYY-MM-DD" --name="yourAwesomeTitle"
```
## <img src="https://webdav-r3lab.uni.lu/public/R3lab/logos/warning.png" height="20px" width="20px"> Tips
- Please create a branch from `develop` before starting to work on your presentation. You could name it `YYYY-MM-DD_yourAwesomeTitle`.
- If you are done with making changes to your presentation, push them to your fork and open a merge request against the `develop` branch.
## <img src="https://webdav-r3lab.uni.lu/public/R3lab/logos/warning.png" height="20px" width="20px">Solving the error: `Fatal error: Unable to find local grunt.`
If you get a fatal error complaining about your local grunt installation, please make sure that you have add the `--recurse-submodules` flag when cloning, or that you ran the `git submodule update --init --recursive` command from within
the `presentations-internal` directory.
Please also make sure that you run the `contribute` command from the root of the `presentations-internal` directory.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment