init: rewrite initialisation script
Milestone %1.13.0 has so many changes, especially to yaml, that the old init.py
will definitely no longer work.
A long standing unofficial plan has to be replace init.py
with init.sh
, in POSIX sh if possible or bash if really needed. I'd say this is the right time to do it.
Instead of patching the real CICD yaml into what the user wants, consider writing a proper templated one. To be concrete:
- A formally templated CICD yaml, containing stuff in the style of
__REPLACE_ME__
-
init.sh
either reads a variable file and/or asks user input for missing vars and usesm4
to process the template yaml into real yaml. - For template purposes, just add some
cicd/init_vars.sh
that the maininit.sh
sources. The style of such a file is simply a variable list matching define names:replace_me='nyan'
This means the template is always edited by hand, and template's real yaml is generated using init.sh
when changes are made.
Note that the CICD yaml is of course not the only thing that init.sh
needs to take care of. Check references from init.py
and also look through the entire repository to determine what needs to be patched on init.
This issue consists of the following tasks
-
Document information collected from the user by init.py
-
Provide a way to collect information, either interactively or in an automated way -
Provide sane defaults -
Keep the template functional without requiring it to be init.sh
'ed -
Make a template for CMakeLists.txt
-
Make a template for .gitlab-ci.yml
-
Automatic generation of Tagfile
s forcicd/docker_targets/*
folders -
Update include/c_template
-
Update source and header files to replace hardcoded values such as c_template
-
Remove pre-initialization files as explained in LICENCE