diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..523ca4c0b60bc5906dd79c2446982a4e95f70ee4 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +image: ubuntu:18.04 + +cache: + paths: + - technical-testing + +stages: + - build + +build:app: + stage: build + script: + - bash ci/00-install/01_install_dependencies.sh # install system dependencies + - bash ci/01-build/01_build_documents.sh # build documents + artifacts: + name: "technical-testing" + expire_in: 6 months + paths: + - technical-testing diff --git a/build.sh b/build.sh deleted file mode 100755 index 56ea1ee139d5818c8c162290c97c24dcc86e7506..0000000000000000000000000000000000000000 --- a/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -#sudo apt-get install pandoc -cat ./??_*.md > build/TECHNICAL_TESTING.md -pandoc --from=markdown --to=odt --output=build/TECHNICAL_TESTING.odt build/TECHNICAL_TESTING.md -pandoc --from=markdown --to=latex --output=build/TECHNICAL_TESTING.pdf build/TECHNICAL_TESTING.md diff --git a/ci/00-install/01_install_dependencies.sh b/ci/00-install/01_install_dependencies.sh new file mode 100644 index 0000000000000000000000000000000000000000..0c0fb68909bb94b8f9a918b9fffbf729090bc1c2 --- /dev/null +++ b/ci/00-install/01_install_dependencies.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# We need to install dependencies only for Docker +[[ ! -e /.dockerenv ]] && exit 0 + +# Display debug in console +if [ -n "${DEBUG}" ]; then + set -xe +fi + +DEBIAN_FRONTEND=noninteractive +TZ=Europe/Paris +ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Install missing dependencies +apt-get update -yqq +apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra diff --git a/ci/01-build/01_build_documents.sh b/ci/01-build/01_build_documents.sh new file mode 100644 index 0000000000000000000000000000000000000000..84a5e58edd36241fc748291d29268cebed8063f9 --- /dev/null +++ b/ci/01-build/01_build_documents.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# will run only in a docker env +[[ ! -e /.dockerenv ]] && exit 0 + +# Display debug in console +if [ -n "${DEBUG}" ]; then + set -xe +fi + +BUILD_FOLDER="technical-testing" +mkdir -p "${BUILD_FOLDER}" + +# Concat all markdown documents +cat ./??_*.md > ${BUILD_FOLDER}/TECHNICAL_TESTING.md + +# Build formatted documents +pandoc --from=markdown --to=odt --output=${BUILD_FOLDER}/TECHNICAL_TESTING.odt ${BUILD_FOLDER}/TECHNICAL_TESTING.md +pandoc --from=markdown --to=latex --output=${BUILD_FOLDER}/TECHNICAL_TESTING.pdf ${BUILD_FOLDER}/TECHNICAL_TESTING.md