Esempio n. 1
0
def run():
    if not workspace().is_configured():
        raise ActionException("Project was not already set up")

    infrastructure().clear()

    if environment().clear_volumes:
        infrastructure().clear_volumes()
Esempio n. 2
0
def print_howto():
    print("Connect to WP via:")
    print("- http://{}/".format(infrastructure().get_wordpress_container_ip()))
    print("- http://{}/ (you need first to run 'register_host')".format(
        workspace().config().project_name))
    print("")
    print(
        "Note: If it is the first time you start the project, you might have to wait a few minutes before WP is actually available."
    )
Esempio n. 3
0
def run():
    infrastructure().stop()
Esempio n. 4
0
def run():
    infrastructure().start()
    print_howto()
Esempio n. 5
0
 def remove_components(self, component_type):
     if os.path.isdir(component_type):
         for dir_item in os.listdir('{}'.format(component_type)):
             self.docker_exec(['exec', '{}'.format(infrastructure().get_wordpress_container().id), 'rm', '-rf', '/var/www/html/wp-content/{}/{}'.format(component_type, dir_item)])
Esempio n. 6
0
 def exec_on_container(self, command_line):
     full_command_line = ['exec', '{}'.format(infrastructure().get_wordpress_container().id)]
     full_command_line.extend(command_line)
     self.docker_exec(full_command_line)
Esempio n. 7
0
 def copy_from_container(self, container_path, local_path):
     self.docker_exec(['cp', '{}:{}'.format(infrastructure().get_wordpress_container().id, container_path), local_path])
Esempio n. 8
0
 def copy_to_container(self, local_path, container_path, owner = None):
     self.docker_exec(['cp', local_path, '{}:{}'.format(infrastructure().get_wordpress_container().id, container_path)])
     if owner:
         self.exec_on_container(['chown', '-R', '{}:{}'.format(owner, owner), container_path])
Esempio n. 9
0
 def run(self):
     container = infrastructure().get_wordpress_container()
     if not container:
         raise ActionException("This WP project must first be started")
     self.run_with_container()
Esempio n. 10
0
 def _run_after_backup(self):
     ip_address = infrastructure().get_wordpress_container_ip()
     self.deregister()
     self.register(ip_address)