Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 40019e53 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

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.
parent d410b9ac
Branches
Étiquettes
1 requête de fusion!105Refactor and more
......@@ -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 ##################################
......
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter