Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.06 KiB
Newer Older
mazenovi's avatar
mazenovi committed
image: ubuntu:xenial
Vincent Mazenod's avatar
Vincent Mazenod committed
    - output/ # le répertoire où se trouve le HTML statique généré

build:
  stage: build
  script:
Vincent Mazenod's avatar
Vincent Mazenod committed
    # dépendances pelican thèmes
mazenovi's avatar
mazenovi committed
    - apt-get install -y --force-yes build-essential python-dev python-pip git nodejs nodejs-legacy npm
mazenovi's avatar
mazenovi committed
    - pip install --upgrade pip==9.0.3
    - pip install -r requirements.txt
m4z3 test's avatar
m4z3 test committed
    - cd content && npm install && cd ..
mazenovi's avatar
mazenovi committed
    - sed -i "s/RELATIVE_URLS = True/RELATIVE_URLS = False/" pelicanconf.py
mazenovi's avatar
mazenovi committed
    - apt-get install -y --force-yes locales
    - locale-gen fr_FR
    - locale-gen fr_FR.UTF-8
    - update-locale LANG=fr_FR.UTF-8
    - . /etc/default/locale
Vincent Mazenod's avatar
Vincent Mazenod committed
    # génération du HTML statique dans le répertoire output
    - pelican content
Vincent Mazenod's avatar
Vincent Mazenod committed
    # dépendance pour l'authentification kerberos
Vincent Mazenod's avatar
Vincent Mazenod committed
    - echo -e "krb5-config krb5-config/default_realm string LOCAL.ISIMA.FR" | debconf-set-selections
    - apt-get install -y --force-yes krb5-user krb5-config
Vincent Mazenod's avatar
Vincent Mazenod committed
    # récupération du KEYTAB en hexa 
Vincent Mazenod's avatar
Vincent Mazenod committed
    - echo "$KEYTAB" > my.keytab.hex
Vincent Mazenod's avatar
Vincent Mazenod committed
    # conversion du KEYTAB en hexa en binaire
Vincent Mazenod's avatar
Vincent Mazenod committed
    - sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' my.keytab.hex | xargs printf > my.keytab
Vincent Mazenod's avatar
Vincent Mazenod committed
    # génération du ticket kerberos
Vincent Mazenod's avatar
Vincent Mazenod committed
    - kinit -k -t my.keytab vimazeno@LOCAL.ISIMA.FR
Vincent Mazenod's avatar
Vincent Mazenod committed
    # préparation du répertoire servi par apache
Vincent Mazenod's avatar
Vincent Mazenod committed
    - ssh -K vimazeno@perso.local.isima.fr "mkdir -p ~/public_html/"
    - ssh -K vimazeno@perso.local.isima.fr "echo 'Options +FollowSymLinks' >  ~/public_html/.htaccess"
    - ssh -K vimazeno@perso.local.isima.fr "echo 'RewriteEngine on' >>  ~/public_html/.htaccess"
    - ssh -K vimazeno@perso.local.isima.fr "echo 'RewriteCond %{HTTP_HOST} ^perso.isima.fr$' >>  ~/public_html/.htaccess"
    - ssh -K vimazeno@perso.local.isima.fr "echo 'RewriteRule (.*) https://perso.limos.fr%{REQUEST_URI} [R=301,L]' >>  ~/public_html/.htaccess"
Vincent Mazenod's avatar
Vincent Mazenod committed
    # rsync du HTML statique généré
mazenovi's avatar
mazenovi committed
    - apt-get install -y --force-yes rsync
Vincent Mazenod's avatar
Vincent Mazenod committed
    - rsync -az --exclude '_' -e "ssh -K" output/ vimazeno@perso.local.isima.fr:~/public_html/
Vincent Mazenod's avatar
Vincent Mazenod committed
  # le déploiement se fera uniquement lorsque je clique sur le "play" de la CI via l'interface gitlab
Vincent Mazenod's avatar
Vincent Mazenod committed
  when: manual