Example #1
0
    def _checkout_package(package, commit):
        repo_folder = Session.matador_repository_folder
        package_folder = Path(
            Session.matador_packages_folder, package)

        shutil.rmtree(str(package_folder), ignore_errors=True)

        Session.update_repository()

        git.checkout(Session.matador_repo, commit)

        src = Path(repo_folder, 'deploy', 'packages', package)
        shutil.copytree(str(src), str(package_folder))
Example #2
0
def execute_ticket(ticket, action, commit, packaged=False):
    ticket_folder = Path(Session.matador_tickets_folder, ticket)
    Session.deployment_folder = ticket_folder

    shutil.rmtree(str(ticket_folder), ignore_errors=True)

    if not packaged:
        Session.update_repository()

    _checkout_ticket(ticket, Session.matador_repo, ticket_folder, commit)

    actionFile = Path(action + '.py')
    sourceFile = Path(ticket_folder, actionFile)
    SourceFileLoader(action, str(sourceFile)).load_module()
Example #3
0
def test_update_repository(project_repo):
    Session.update_repository()
    refs = LocalGitClient().get_refs(str(Session.matador_repository_folder))
    assert b'refs/remotes/origin/master' in refs