def create_cmfive_config_file(self, db_hostname): # add or override db_hostname config tokens = dict(self.config) tokens.update({"db_hostname": db_hostname}) # render template into stage dir util.inflate_template( self.dirs.cmfive.joinpath("config.php.template"), self.dirs.stage, ".template", tokens, False ) # copy file into container(s) for container in DockerCompose.containers_by_service(self.SERVICE_NAME): container.copy_file_into( source=self.dirs.stage.joinpath("config.php"), target="/var/www/html/config.php" )
def container_by_index(index): containers = list(DockerCompose.containers_by_service(WebService.SERVICE_NAME)) return containers[index]
def run(self, command): """run command against web service container(s)""" for container in DockerCompose.containers_by_service(self.SERVICE_NAME): container.run_command(command)