예제 #1
0
def update_site_core(project='pantheon', keep=None):
    """Update Drupal core (from Drupal or Pressflow, to latest Pressflow).
       keep: Option when merge fails:
             'ours': Keep local changes when there are conflicts.
             'theirs': Keep upstream changes when there are conflicts.
             'force': Leave failed merge in working-tree (manual resolve).
             None: Reset to ORIG_HEAD if merge fails.
    """
    updater = update.Updater(project, 'dev')
    try:
        result = updater.core_update(keep)
        updater.drupal_updatedb()
        updater.permissions_update()
    except:
        jenkinstools.junit_error(traceback.format_exc(), 'UpdateCore')
        raise
    else:
        jenkinstools.junit_pass('Update successful.', 'UpdateCore')

    postback.write_build_data('update_site_core', result)

    if result['merge'] == 'success':
        # Send drupal version information.
        status.drupal_update_status(project)
        status.git_repo_status(project)
예제 #2
0
def update_site_core(project='pantheon', keep=None):
    """Update Drupal core (from Drupal or Pressflow, to latest Pressflow).
       keep: Option when merge fails:
             'ours': Keep local changes when there are conflicts.
             'theirs': Keep upstream changes when there are conflicts.
             'force': Leave failed merge in working-tree (manual resolve).
             None: Reset to ORIG_HEAD if merge fails.
    """
    updater = update.Updater(project, 'dev')
    try:
        result = updater.core_update(keep)
        updater.drupal_updatedb()
        updater.permissions_update()
    except:
        jenkinstools.junit_error(traceback.format_exc(), 'UpdateCore')
        raise
    else:
        jenkinstools.junit_pass('Update successful.', 'UpdateCore')

    postback.write_build_data('update_site_core', result)

    if result['merge'] == 'success':
        # Send drupal version information.
        status.drupal_update_status(project)
        status.git_repo_status(project)
def _installer(**kw):
    #TODO: Move logging into pantheon libraries for better coverage.
    log = logger.logging.getLogger('pantheon.install.site')
    log = logger.logging.LoggerAdapter(log, kw)
    log.info('Site installation of project %s initiated.' % kw.get('project'))
    try:
        installer = install.InstallTools(**kw)

        # Remove existing project.
        installer.remove_project()

        # Create a new project
        if kw['profile'] == 'pantheon':
            installer.setup_project_repo()
            installer.setup_project_branch()
            installer.setup_working_dir()
        elif kw['profile'] == 'makefile':
            installer.process_makefile(kw['url'])
        elif kw['profile'] == 'gitsource':
            installer.process_gitsource(kw['url'])

        # Run bcfg2 project bundle.
        installer.bcfg2_project()

        # Setup project
        installer.setup_database()
        installer.setup_files_dir()
        installer.setup_settings_file()
        installer.setup_pantheon_modules()
        installer.setup_pantheon_libraries()

        # Push changes from working directory to central repo
        installer.push_to_repo()

        # Build non-code site features.
        installer.setup_solr_index()
        installer.setup_drupal_cron()
        installer.setup_drush_alias()

        # Clone project to all environments
        installer.setup_environments()

        # Cleanup and restart services
        installer.cleanup()
        installer.server.restart_services()

        # Send back repo status.
        status.git_repo_status(installer.project)
        status.drupal_update_status(installer.project)

        # Set permissions on project
        installer.setup_permissions()

    except:
        log.exception('Site installation was unsuccessful')
        raise
    else:
        log.info('Site installation successful')
예제 #4
0
def _installer(**kw):
    #TODO: Move logging into pantheon libraries for better coverage.
    log = logger.logging.getLogger('pantheon.install.site')
    log = logger.logging.LoggerAdapter(log, kw)
    log.info('Site installation of project %s initiated.' % kw.get('project'))
    try:
        installer = install.InstallTools(**kw)

        # Remove existing project.
        installer.remove_project()

        # Create a new project
        if kw['profile'] == 'pantheon':
            installer.setup_project_repo()
            installer.setup_project_branch()
            installer.setup_working_dir()
        elif kw['profile'] == 'makefile':
            installer.process_makefile(kw['url'])
        elif kw['profile'] == 'gitsource':
            installer.process_gitsource(kw['url'])

        # Run bcfg2 project bundle.
        installer.bcfg2_project()

        # Setup project
        installer.setup_database()
        installer.setup_files_dir()
        installer.setup_settings_file()

        # Push changes from working directory to central repo
        installer.push_to_repo()

        # Build non-code site features.
        installer.setup_solr_index()
        installer.setup_drupal_cron()
        installer.setup_drush_alias()

        # Clone project to all environments
        installer.setup_environments()

        # Cleanup and restart services
        installer.cleanup()
        installer.server.restart_services()

        # Send back repo status.
        status.git_repo_status(installer.project)
        status.drupal_update_status(installer.project)

        # Set permissions on project
        installer.setup_permissions()

    except:
        log.exception('Site installation was unsuccessful')
        raise
    else:
        log.info('Site installation successful')
예제 #5
0
    def build(self, location):

        self.build_location = location
        # Parse the extracted archive.
        self.parse_archive(location)

        # Remove existing project.
        self.remove_project()

        # Create a new project
        self.setup_project_repo()
        self.setup_project_branch()

        # Run bcfg2 project bundle.
        self.bcfg2_project()

         # Import existing site into the project.
        self.setup_database()
        self.import_site_files()
        self.setup_files_dir()
        self.setup_settings_file()
        self.setup_pantheon_modules()
        self.setup_pantheon_libraries()

        # Push imported project from working directory to central repo
        self.push_to_repo()

        # Build non-code site features
        self.setup_solr_index()
        self.setup_drupal_cron()
        self.setup_drush_alias()

        # Turn on modules, set variables
        self.enable_pantheon_settings()

        # Clone project to all environments
        self.setup_environments()

        # Set permissions on project.
        self.setup_permissions()

        # Cleanup and restart services.
        self.cleanup()
        self.server.restart_services()

        # Send version and repo status.
        status.git_repo_status(self.project)
        status.drupal_update_status(self.project)
예제 #6
0
    def build(self, location):

        # Parse the extracted archive.
        self.parse_archive(location)

        # Remove existing project.
        self.remove_project()

        # Create a new project
        self.setup_project_repo()
        self.setup_project_branch()

        # Run bcfg2 project bundle.
        self.bcfg2_project()

        # Import existing site into the project.
        self.setup_database()
        self.import_site_files()
        self.setup_files_dir()
        self.setup_settings_file()
        self.setup_pantheon_modules()
        self.setup_pantheon_libraries()

        # Push imported project from working directory to central repo
        self.push_to_repo()

        # Build non-code site features
        self.setup_solr_index()
        self.setup_drupal_cron()
        self.setup_drush_alias()

        # Turn on modules, set variables
        self.enable_pantheon_settings()

        # Clone project to all environments
        self.setup_environments()

        # Set permissions on project.
        self.setup_permissions()

        # Cleanup and restart services.
        self.cleanup()
        self.server.restart_services()

        # Send version and repo status.
        status.git_repo_status(self.project)
        status.drupal_update_status(self.project)
예제 #7
0
파일: update.py 프로젝트: emphanos/mercury
def update_code(project, environment, tag=None, message=None, taskid=None):
    """ Update the working-tree for project/environment.

    """
    if not tag:
        tag = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
    if not message:
        message = "Tagging as %s for release." % tag

    updater = update.Updater(environment)
    updater.test_tag(tag)
    updater.code_update(tag, message)
    updater.permissions_update()

    # Send back repo status and drupal update status
    status.git_repo_status(project)
    status.drupal_update_status(project)
예제 #8
0
파일: update.py 프로젝트: emphanos/mercury
def update_code(project, environment, tag=None, message=None, taskid=None):
    """ Update the working-tree for project/environment.

    """
    if not tag:
        tag = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
    if not message:
        message = 'Tagging as %s for release.' % tag

    updater = update.Updater(environment)
    updater.test_tag(tag)
    updater.code_update(tag, message)
    updater.permissions_update()

    # Send back repo status and drupal update status
    status.git_repo_status(project)
    status.drupal_update_status(project)
예제 #9
0
    def build(self, **kw):

        # Remove existing project.
        self.remove_project()

        # Create a new project
        self.setup_project_repo()
        self.setup_project_branch()
        self.setup_working_dir()

        # Run bcfg2 project bundle.
        self.bcfg2_project()

        # Setup project
        self.setup_database()
        self.setup_files_dir()
        self.setup_settings_file()
        self.setup_pantheon_modules()
        self.setup_pantheon_libraries()

        # Push changes from working directory to central repo
        self.push_to_repo()

        # Build non-code site features.
        self.setup_solr_index()
        self.setup_drupal_cron()
        self.setup_drush_alias()

        # Clone project to all environments
        self.setup_environments()

        # Cleanup and restart services
        self.cleanup()
        self.server.restart_services()

        # Send back repo status.
        status.git_repo_status(self.project)
        status.drupal_update_status(self.project)

        # Set permissions on project
        self.setup_permissions()
예제 #10
0
    def build(self, **kw):

        # Remove existing project.
        self.remove_project()

        # Create a new project
        self.setup_project_repo()
        self.setup_project_branch()
        self.setup_working_dir()

        # Run bcfg2 project bundle.
        self.bcfg2_project()

        # Setup project
        self.setup_database()
        self.setup_files_dir()
        self.setup_settings_file()
        self.setup_pantheon_modules()
        self.setup_pantheon_libraries()

        # Push changes from working directory to central repo
        self.push_to_repo()

        # Build non-code site features.
        self.setup_solr_index()
        self.setup_drupal_cron()
        self.setup_drush_alias()

        # Clone project to all environments
        self.setup_environments()

        # Cleanup and restart services
        self.cleanup()
        self.server.restart_services()

        # Send back repo status.
        status.git_repo_status(self.project)
        status.drupal_update_status(self.project)

        # Set permissions on project
        self.setup_permissions()
예제 #11
0
파일: update.py 프로젝트: emphanos/mercury
def update_site_core(project="pantheon", keep=None, taskid=None):
    """Update Drupal core (from Drupal or Pressflow, to latest Pressflow).
       keep: Option when merge fails:
             'ours': Keep local changes when there are conflicts.
             'theirs': Keep upstream changes when there are conflicts.
             'force': Leave failed merge in working-tree (manual resolve).
             None: Reset to ORIG_HEAD if merge fails.
    """
    updater = update.Updater("dev")
    result = updater.core_update(keep)
    if result["merge"] == "success":
        # Send drupal version information.
        status.drupal_update_status(project)
        status.git_repo_status(project)
        updater.permissions_update()
        postback.write_build_data("update_site_core", result)

    else:
        log = logger.logging.getLogger("pantheon.update_site_core")
        updater.permissions_update()
        log.error("Upstream merge did not succeed. Review conflicts.")
예제 #12
0
파일: update.py 프로젝트: emphanos/mercury
def update_site_core(project='pantheon', keep=None, taskid=None):
    """Update Drupal core (from Drupal or Pressflow, to latest Pressflow).
       keep: Option when merge fails:
             'ours': Keep local changes when there are conflicts.
             'theirs': Keep upstream changes when there are conflicts.
             'force': Leave failed merge in working-tree (manual resolve).
             None: Reset to ORIG_HEAD if merge fails.
    """
    updater = update.Updater('dev')
    result = updater.core_update(keep)
    if result['merge'] == 'success':
        # Send drupal version information.
        status.drupal_update_status(project)
        status.git_repo_status(project)
        updater.permissions_update()
        postback.write_build_data('update_site_core', result)

    else:
        log = logger.logging.getLogger('pantheon.update_site_core')
        updater.permissions_update()
        log.error('Upstream merge did not succeed. Review conflicts.')
예제 #13
0
    def build(self, location):

        # Parse the backup.
        self.parse_backup(location)

        # Run bcfg2 project bundle.
        self.bcfg2_project()

        self.setup_database()
        self.restore_site_files()
        self.restore_repository()

        # Build non-code site features
        self.setup_solr_index()
        self.setup_drupal_cron()
        self.setup_drush_alias()

        self.setup_permissions()
        self.server.restart_services()

        # Send version and repo status.
        status.git_repo_status(self.project)
        status.drupal_update_status(self.project)
예제 #14
0
    def build(self, location):

        # Parse the backup.
        self.parse_backup(location)

        # Run bcfg2 project bundle.
        self.bcfg2_project()

        self.setup_database()
        self.restore_site_files()
        self.restore_repository()

        # Build non-code site features
        self.setup_solr_index()
        self.setup_drupal_cron()
        self.setup_drush_alias()

        self.setup_permissions()
        self.server.restart_services()

        # Send version and repo status.
        status.git_repo_status(self.project)
        status.drupal_update_status(self.project)
예제 #15
0
def update_code(project, environment, tag=None, message=None):
    """ Update the working-tree for project/environment.

    """
    if not tag:
        tag = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
    if not message:
        message = 'Tagging as %s for release.' % tag

    updater = update.Updater(project, environment)
    try:
        updater.test_tag(tag)
        updater.code_update(tag, message)
        updater.drupal_updatedb()
        updater.permissions_update()
    except:
        jenkinstools.junit_error(traceback.format_exc(), 'UpdateCode')
        raise
    else:
        jenkinstools.junit_pass('Update successful.', 'UpdateCode')

    # Send back repo status and drupal update status
    status.git_repo_status(project)
    status.drupal_update_status(project)
예제 #16
0
def update_code(project, environment, tag=None, message=None):
    """ Update the working-tree for project/environment.

    """
    if not tag:
        tag = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
    if not message:
        message = 'Tagging as %s for release.' % tag

    updater = update.Updater(project, environment)
    try:
        updater.test_tag(tag)
        updater.code_update(tag, message)
        updater.drupal_updatedb()
        updater.permissions_update()
    except:
        jenkinstools.junit_error(traceback.format_exc(), 'UpdateCode')
        raise
    else:
        jenkinstools.junit_pass('Update successful.', 'UpdateCode')

    # Send back repo status and drupal update status
    status.git_repo_status(project)
    status.drupal_update_status(project)