From 40019e5343c879fde584c91a283693ee3a151d72 Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Sun, 2 Aug 2020 15:42:54 +0200 Subject: [PATCH] CI: Separate build and install folder from src The src folder seems to be re-init between jobs (at least, created folders are no longer here), so create build and install folders elsewhere. --- .gitlab-ci.yml | 9 +++++++-- scripts/validate.bash | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee7df417..698c883e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,11 @@ stages: .breaking_tests: &breaking_tests allow_failure: true +variables: + GIT_DEPTH: 10 # No need to clone all the history + SRC_DIR: $CI_PROJECT_DIR # Where the sources are + WORK_DIR: $HOME/CI_$CI_PIPELINE_ID # Where we will work, so that it's not erased + ################################################# ### Initialization and Finalization ############# ################################################# @@ -23,7 +28,7 @@ env_sanitize: <<: *main_tests stage: initialization script: - - mkdir -p $CI_PROJECT_DIR/{build.clang,build.gcc,install.clang,install.gcc} + - mkdir -p $WORK_DIR/{build.clang,build.gcc,install.clang,install.gcc} - echo "Env is intialized" env_finalize: @@ -31,7 +36,7 @@ env_finalize: stage: finalization allow_failure: true when: on_success - script: rm -rf $CI_PROJECT_DIR + script: rm -rf $WORK_DIR ################################################# ### Configures ################################## diff --git a/scripts/validate.bash b/scripts/validate.bash index d83ffc50..7d817ee8 100755 --- a/scripts/validate.bash +++ b/scripts/validate.bash @@ -14,12 +14,17 @@ LKT_DIR="$PWD" # The project directory LKT_CONFIGURE_OPTIONS="" # Options to pass to the configure command LKT_CORE_NUMBER=4 # Number of cores to use with make LKT_TEST="" # Which tests to perform +LKT_SRC=$SRC_DIR # Where to find the sources of lektor + +# Below: global variables that will be initialized latter +LKT_INSTALL="" # Install folder of lektor +LKT_BUILD="" # Build folder of lektor ### AVAILABLE TESTS ########################################################## function test_simple () { - check_cd $LKT_DIR/install.$LKT_COMPILER/ + check_cd $LKT_INSTALL ./lektord & local _child_pid=$! ./lkt pwd=hashire adm kil @@ -84,9 +89,7 @@ SQLITE3=$(which sqlite3) # - LKT_CONFIGURE_OPTIONS Options to pass to the configure command # function do_configure () { - check_cd $LKT_DIR - mkdir {build,install}.$LKT_COMPILER - check_cd build.$LKT_COMPILER + check_cd $LKT_BUILD check_configure \ --prefix=$LKT_DIR/install.$LKT_COMPILER \ $LKT_CONFIGURE_OPTIONS @@ -99,7 +102,7 @@ function do_configure () # - LKT_COMPILER The compiler used to build # function do_build () { - check_cd $LKT_DIR/build.$LKT_COMPILER + check_cd $LKT_BUILD check_make -j$LKT_CORE_NUMBER check_make install check_cd $LKT_DIR @@ -132,7 +135,6 @@ function do_steps () # - LKT_DIR The project root directory # function do_launch () { - check_cd $LKT_DIR for test in $LKT_TEST ; do case "$test" in simple) test_simple;; @@ -185,6 +187,12 @@ for arg in $* ; do esac done +### GLOBALS THAT NEEDS ARGUMENTS TO BE INITIALIZED ########################### +# - LKT_INSTALL Where lektor will be installed # +# - LKT_BUILD Where lektor will be configured # +LKT_INSTALL=$WORK_DIR/install.$LKT_COMPILER +LKT_BUILD=$WORK_DIR/build.$LKT_COMPILER + ### DO OUR STUFF HERE ######################################################## process_args do_steps -- GitLab