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

CI: Prepare folders outside of cloned dir, use validate.bash

parent 11400560
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!105Refactor and more
......@@ -12,8 +12,8 @@ stages:
- main
- merge_requests
variables:
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
SRC_DIR: $CI_PROJECT_DIR # Where the sources are
WORK_DIR: "/home/gitlab-runner/CI_$CI_PIPELINE_ID" # Where we will work, so that it's not erased
.breaking_tests: &breaking_tests
allow_failure: true
......@@ -29,7 +29,9 @@ env_sanitize:
<<: *main_tests
stage: initialization
script:
- mkdir -p $WORK_DIR/{build.clang,build.gcc,install.clang,install.gcc}
- export # For debug purpose
- scripts/validate.bash --build=gcc --step=prepare
- scripts/validate.bash --build=clang --step=prepare
- echo "Env is intialized"
env_finalize:
......
......@@ -15,6 +15,7 @@ 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
LKT_WORK=$WORK_DIR # The work dir, where to play
# Below: global variables that will be initialized latter
LKT_INSTALL="" # Install folder of lektor
......@@ -45,6 +46,11 @@ function check_cd ()
cd $1 || die "Can't go to folder $1"
}
function check_mkdir ()
{
mkdir $* || die "Failed to mkdir '$*'"
}
function check_configure ()
{
$LKT_DIR/configure $* || die "Failed to configure with $LKT_COMPILER"
......@@ -82,6 +88,17 @@ fi
SQLITE3=$(which sqlite3)
[ $? -ne 0 ] && die "Can't find the sqlite3 executable"
### PREPARE ##################################################################
# Globals: #
# - LKT_COMPILER Which compiler to use #
# - LKT_WORK The base folder which will contains all the #
# builds and installs #
function do_prepare ()
{
check_mkdir -p $LKT_WORK/{build.$LKT_COMPILER,install.$LKT_COMPILER}
echo "Created folders $LKT_WORK/{build.$LKT_COMPILER,install.$LKT_COMPILER}"
}
### CONFIGURE ################################################################
# Globals: #
# - LKT_DIR Project root directory #
......@@ -113,6 +130,7 @@ function do_build ()
# - LKT_STEP Steps to perform #
function do_steps ()
{
local _prepare=""
local _build=""
local _configure=""
local _launch=""
......@@ -121,9 +139,11 @@ function do_steps ()
build) _build="yes";;
configure) _configure="yes";;
launch) _launch="yes";;
prepare) _prepare="yes";;
esac
done
[ "x$_prepare" = "xyes" ] && do_prepare
[ "x$_configure" = "xyes" ] && do_configure
[ "x$_build" = "xyes" ] && do_build
[ "x$_launch" = "xyes" ] && do_launch
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter