def generate_setup(self): """Create the setup script""" template_engine = TemplateEngine() template_context = {} template_context["scripts"] = self.__setup_scripts template_context["images"] = self.__images with open(self.__filename, "w") as script_file: script_file.write( template_engine.render_template("templates/setup/setup.sh.tpl", template_context)) os.chmod( self.__filename, stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | stat.S_IWUSR | stat.S_IWGRP)
def get_setup(self): context = {} template_engine = TemplateEngine() setup_data = template_engine.render_template("templates/software/docker-compose-setup.sh.tpl", context) return setup_data