Edited wizzard, runner: first run - do not run CI!
This commit is contained in:
@@ -71,6 +71,21 @@ function createConfigFile(){
|
||||
EOF
|
||||
}
|
||||
|
||||
function createDetectorConfig(){
|
||||
# $1 - file
|
||||
local cfgFile=$1
|
||||
|
||||
mkdir -p $(dirname $cfgFile)
|
||||
|
||||
if [ $read_detector -eq 1 ]
|
||||
then
|
||||
cat > $cfgFile <<-EOF
|
||||
# this file is config for detector
|
||||
# now, it is empty - to disable detector, just delete it!
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
function generateSSHKey(){
|
||||
# generates ssh key with $1 path and $2 description
|
||||
local keyfile=$1/id_rsa
|
||||
@@ -137,6 +152,19 @@ else
|
||||
read_submodule_limit=N
|
||||
fi
|
||||
|
||||
|
||||
# determine CI?
|
||||
echo -n "Do you want to enable CI support? (detector) [Y/n]"
|
||||
read read_detector
|
||||
[ -n "$read_detector" ] || read_detector=Y
|
||||
if ! [[ "$read_detector" =~ ^[Yy]$ ]]
|
||||
then
|
||||
read_detector=0
|
||||
else
|
||||
read_detector=1
|
||||
fi
|
||||
|
||||
|
||||
root=/data/$dir_prefix-$read_project_name
|
||||
# start generating config
|
||||
mkdir -p $root/config
|
||||
@@ -166,6 +194,7 @@ then
|
||||
reuseSSHKey $root/config/auth/ssh/id_rsa
|
||||
fi
|
||||
|
||||
|
||||
echo "First run - initialization of repos..."
|
||||
if ! env BASE=$root run-checker
|
||||
then
|
||||
@@ -177,6 +206,7 @@ then
|
||||
rm -Rf $root
|
||||
fi
|
||||
else
|
||||
createDetectorConfig $root/config/detector.cfg
|
||||
echo "Setup has finished!"
|
||||
touch $root/.enabled
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user