Пример #1
0
def branches(folder):
    # statement = "cd " + folder + ";" + "git ls-remote --heads origin"
    statement = f"cd {folder};git ls-remote --heads origin"
    output = command.execute(statement)
    output = command.stringify(output)

    # p = Popen([statement], stdout=PIPE, shell=True)
    # output, error = p.communicate()
    # if p.returncode != 0:
    #     raise PluginException(error)

    lines = output.split("\n")
    results = []
    for line in lines:
        if line:
            results.append(line.split("\t")[1].replace('refs/heads/', ''))
    return results
Пример #2
0
def checkout(version, folder):
    output = command.execute(f"cd {folder};git checkout {version}")
    return command.stringify(output)
Пример #3
0
def push(repository, branch, folder):
    output = command.execute(f"cd {folder};git push --tags {repository} {branch}")
    return command.stringify(output)
Пример #4
0
def tag(version, folder):
    output = command.execute(f"cd {folder}; git tag -a {version} -m '{version}'")
    return command.stringify(output)
Пример #5
0
def commit(version, folder):
    output = command.execute(f"cd {folder};git commit -a --message='updated to version {version}'")
    return command.stringify(output)
Пример #6
0
def clone(repository, folder):
    output = command.execute(f"git clone {repository} {folder}")
    return command.stringify(output)
Пример #7
0
def upload(folder, username, password):
    output = command.execute(
        f"cd {folder};twine upload --username {username} --password '{password}' dist/*"
    )
    return command.stringify(output)
Пример #8
0
def build(folder):
    output = command.execute(f"cd {folder};python3 -m build",
                             print_output=True)
    return command.stringify(output)