html5as: from plone.recipe.command to slapos.recipe.build
In the instance_html5as.cfg.in
file, the downloader
section has now the recipe slapos.recipe.build
instead of plone.recipe.command
.
The main goal is to stop using bash, and use python instead.
So, instead of using curl
and tar
like we did before:
command =
rm -rf ${html5as:docroot}/*;
URL = {{ parameter_dict['download_url'] }};
if [ -n "$URL" ];
then
${html5as:curl-binary} -Lks $URL | ${html5as:tar-binary} xzv -C ${html5as:docroot} --strip-components 1;
else
cp ${default_index_html:rendered} ${html5as:docroot}/;
fi
we use fonctions such as download
or extract
and others that can be found in the slapos.recipe.build repository.
We can also remove rm -r
and use the location
option which indicates the path where the recipe stores any produced file. This directory will be automatically removed next time it runs if the recipe options change, so we don't have to use rm -rf
anymore.
I've added some comments to help understand the code and answer your questions.