Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • prez
2 results

Target

Select target project
No results found
Select Git revision
  • master
1 result
Show changes
717 files
+ 62258
8847
Compare changes
  • Side-by-side
  • Inline

Files

+22 −0
Original line number Diff line number Diff line
FROM debian:stable
ARG DEBIAN_FRONTEND=noninteractive

RUN { \
        echo krb5-config krb5-config/default_realm string 'LOCAL.ISIMA.FR'; \
        echo tzdata tzdata/Areas string 'Etc'; \
        echo tzdata tzdata/Zones/Etc string 'UTC'; \
    } | debconf-set-selections \
    && \
    apt-get update && apt-get install -y --no-install-recommends \
        krb5-user \
        krb5-config \
        openssh-client \
        locales \
        rsync \
    && \
    locale-gen fr_FR \
    locale-gen fr_FR.UTF-8 \
    update-locale LANG=fr_FR.UTF-8 \
    . /etc/default/locale

WORKDIR /srv/blog
 No newline at end of file
+16 −0
Original line number Diff line number Diff line
FROM debian:stable

RUN apt-get update && apt-get install -y --no-install-recommends \
        python3 \
        python3-pip \
        locales \
    && \
    locale-gen fr_FR \
    locale-gen fr_FR.UTF-8 \
    update-locale LANG=fr_FR.UTF-8 \
    . /etc/default/locale

COPY requirements.txt .
RUN pip install --break-system-packages --user -r requirements.txt

WORKDIR /srv/blog
 No newline at end of file
+16 −0
Original line number Diff line number Diff line
source .env 
SSH_CMD="ssh -o StrictHostKeyChecking=no -K ${KRB_USER}@${SERVER}"
RSYNC_CMD=''
kinit ${KRB_USER}
${SSH_CMD} "mkdir -p ~/public_html/"
${SSH_CMD} "echo 'Options +FollowSymLinks' >  ~/public_html/.htaccess"
${SSH_CMD} "echo 'RewriteEngine on' >>  ~/public_html/.htaccess"
${SSH_CMD} "echo 'RewriteCond %{HTTP_HOST} ^perso.isima.fr$' >>  ~/public_html/.htaccess"
${SSH_CMD} "echo 'RewriteRule (.*) https://perso.limos.fr%{REQUEST_URI} [R=301,L]' >>  ~/public_html/.htaccess"
${SSH_CMD} "mkdir -p ~/public_html/_"
${SSH_CMD} "echo '<FilesMatch "\.phar">' >  ~/public_html/_/.htaccess"
${SSH_CMD} "echo '   php_flag engine off' >>  ~/public_html/_/.htaccess"
${SSH_CMD} "echo '   ForceType application/octet-stream' >>  ~/public_html/_/.htaccess"
${SSH_CMD} "echo '   Header set Content-Disposition attachment' >>  ~/public_html/_/.htaccess"
${SSH_CMD} "echo '</FilesMatch>' >>  ~/public_html/_/.htaccess"
rsync -az --exclude "_" -e "ssh -o StrictHostKeyChecking=no -K" ./output/ ${KRB_USER}@${SERVER}:~/public_html/
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
git submodule init
git submodule update --recursive --remote
sed -i 's/\$port &/\$port/g' ./develop_server.sh
chmod +x develop_server.sh
export PATH=/root/.local/bin:$PATH
export PY='/usr/bin/python3'
./develop_server.sh start 8000
 No newline at end of file

.env

0 → 100644
+6 −0
Original line number Diff line number Diff line
PORT=8001
REGISTRY_URL=docker.isima.fr
NAMESPACE=docker.isima.fr/vimazeno
APP_NAME=pelican_perso
KRB_USER=vimazeno
SERVER=perso.local.isima.fr
+2 −0
Original line number Diff line number Diff line
@@ -5,3 +5,5 @@ pelican.pid
srv.pid
blog_limos.egg-info
node_modules
.venv
.vscode
 No newline at end of file
+32 −28
Original line number Diff line number Diff line
image: ubuntu:xenial

cache:
  paths:
    - output/ # Node modules and dependencies
    - output/ # le répertoire où se trouve le HTML statique généré

before_script:
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  - eval $(ssh-agent -s)
  - ssh-add <(echo "$SSH_PRIVATE_KEY")
  - mkdir -p ~/.ssh
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
.pre:
  image: node:latest
  stage: .pre
  script:
    - cd /srv/blog/content/slides && yarn

build:
  image: docker.isima.fr/vimazeno/pelican_perso_python:35046e8
  stage: build
  script:
    - apt-get install -y --force-yes build-essential python-dev python-pip git nodejs nodejs-legacy npm
    - pip install --upgrade pip
    - pip install --editable .
    - cd content && npm install && cd ..
    - sed -i "s/RELATIVE_URLS = True/RELATIVE_URLS = False/" pelicanconf.py
    - 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
    - pelican content

  artifacts:
    untracked: true
    - git submodule init
    - git submodule update --recursive --remote
    - PATH=/root/.local/bin:$PATH pelican
  
deploy:
  image: docker.isima.fr/vimazeno/pelican_perso_kerberos:35046e8
  stage: deploy
  dependencies:
    - build
  script:
    - apt-get install -y --force-yes rsync
    - rsync -az --exclude '_' -e ssh output/ $USERNAME@$HOST:~/public_html/
    # récupération du KEYTAB en hexa 
    - echo "$KEYTAB" > my.keytab.hex
    # conversion du KEYTAB en hexa en binaire
    - sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' my.keytab.hex | xargs printf > my.keytab
    # génération du ticket kerberos
    - kinit -k -t my.keytab vimazeno@LOCAL.ISIMA.FR
    # préparation du répertoire servi par apache
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "mkdir -p ~/public_html/"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo 'Options +FollowSymLinks' >  ~/public_html/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo 'RewriteEngine on' >>  ~/public_html/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo 'RewriteCond %{HTTP_HOST} ^perso.isima.fr$' >>  ~/public_html/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo 'RewriteRule (.*) https://perso.limos.fr%{REQUEST_URI} [R=301,L]' >>  ~/public_html/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "mkdir -p ~/public_html/_"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo '<FilesMatch "\.phar">' >  ~/public_html/_/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo '   php_flag engine off' >>  ~/public_html/_/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo '   ForceType application/octet-stream' >>  ~/public_html/_/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo '   Header set Content-Disposition attachment' >>  ~/public_html/_/.htaccess"
    - ssh -o StrictHostKeyChecking=no -K vimazeno@perso.local.isima.fr "echo '</FilesMatch>' >>  ~/public_html/_/.htaccess"
    # rsync du HTML statique généré
    - rsync -az --exclude '_' -e "ssh -o StrictHostKeyChecking=no -K" output/ vimazeno@perso.local.isima.fr:~/public_html/
 No newline at end of file