From 2eb27fa2db2eda35a2d73aed305c8fda0b93b67e Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sun, 22 Nov 2020 09:15:16 +0200 Subject: [PATCH] GitLab CI. Build on the webserver and save the files in the right directory. Relax the Python version in Pipfile (I use a different version locally to the one in CI). Set the language and locale to C.UTF-8 (the Docker image doesn't come with other locales/ languages). Correct the submodule URL to avoid the redirection warning. --- .gitlab-ci.yml | 18 ++++++++++++++++++ .gitmodules | 2 +- Pipfile | 2 +- pelicanconf.py | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8597428 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +--- +variables: + GIT_SUBMODULE_STRATEGY: recursive + +build: + tags: ["host01.shore.co.il"] + script: + - cid="$(basename $(cat /proc/1/cpuset))" + - docker pull adarnimrod/ci-images:python3 + - >- + docker run + --rm + --env "LANG=C.UTF-8" + --volumes-from "$cid" + --volume "/var/www/www.shore.co.il/blog:/builds/nimrod/blog/output" + --workdir "/builds/nimrod/blog" + adarnimrod/ci-images:python3 + /bin/sh -xc "pipenv --python=python3 install && pipenv run clean && pipenv run build" diff --git a/.gitmodules b/.gitmodules index 038aad3..c806d0b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "pelican-mockingbird"] path = pelican-mockingbird - url = https://git.shore.co.il/nimrod/pelican-mockingbird.git + url = https://git.shore.co.il/nimrod/pelican-mockingbird.git/ diff --git a/Pipfile b/Pipfile index 71448a6..60c51b6 100644 --- a/Pipfile +++ b/Pipfile @@ -10,7 +10,7 @@ pelican-minification = "*" [dev-packages] [requires] -python_version = "3.6" +python_version = "3" [scripts] build = "pelican --settings publishconf.py" diff --git a/pelicanconf.py b/pelicanconf.py index df5f245..6509394 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -39,4 +39,4 @@ DELETE_OUTPUT_DIRECTORY = True SLUGIFY_SOURCE = 'basename' ARTICLE_SAVE_AS = '{slug}/index.html' -LOCALE = ('en_US.utf8') +LOCALE = ('C.UTF-8') -- GitLab