コード例 #1
0
ファイル: tasks.py プロジェクト: cmigazzi/P13_Final
def deploy(c):
    c = Connection(os.environ.get("SSH_ADDRESS"),
                   connect_kwargs={"passphrase": os.environ.get("PASSPHRASE")})
    c.run(f"mkdir -p {SITE_FOLDER}")
    with c.cd(f"{SITE_FOLDER}"):
        _get_latest_sources(c)
        _update_pipenv(c)
        _update_staticfiles(c)
        _update_migrations(c)
コード例 #2
0
def del_file(file_path):
    c = Connection('localhost')
    with c.cd("/home/tomcat/shiwm-service/"):
        res = c.run('[ -d %s ] && echo 00 || echo 11' % file_path,
                    hide=True).stdout
        logging.info("The res is %s" % res)
        if res.startswith("00"):
            c.run("rm -rf ./sftp-duizhang/")
            logging.info("The die is exits, delete it now.")
            c.run("mkdir -p sftp-duizhang")
            logging.info("The die isn't exits, mkdir it now.")
        else:
            c.run("mkdir -p sftp-duizhang")
            logging.info("The die isn't exits, mkdir it now.")
コード例 #3
0
ファイル: tasks.py プロジェクト: jrabbit/pyborg-1up
def deploy(c, restart=False, sync=False):
    "push code to a server (configure your own here)"

    c.run("git push --all")
    conn = Connection("trotsky")
    with conn.cd("src/pyborg-1up"):
        conn.run("git fetch")
        conn.run("git stash")
        conn.run("git pull")
        conn.run("git stash pop")
        if sync:
            conn.run("~/.local/bin/pipenv sync")  # they all use the same pipenv managed virtualenv
        if restart:
            for unit in ["pyborg_discord", "pyborg_http", "pyborg_twitter", "pyborg_mastodon"]:
                conn.sudo("systemctl restart {}".format(unit), pty=True)
        print("Deploy Completed.")
コード例 #4
0
def deploy(c, git=True, restart=False, sync=False, target_machine="trotsky"):
    "push code to a server (configure your own here)"

    # desired_services = ["pyborg_discord", "pyborg_http", "pyborg_twitter", "pyborg_mastodon"]
    desired_services = ["pyborg_discord", "pyborg_http"]
    if git:
        c.run("git push --all")
    conn = Connection(target_machine)
    with conn.cd("src/pyborg-1up"):
        conn.run("git fetch")
        conn.run("git stash")
        conn.run("git pull")
        conn.run("git stash pop")
        if sync:
            conn.run("~/.poetry/bin/poetry install -v"
                     )  # poetry manages this application
        if restart:
            units = " ".join(desired_services)
            conn.run("sudo systemctl restart {}".format(units), pty=True)
            print("Restarted services.")
        print("Deploy Completed.")
コード例 #5
0
def deploy(c, restart=False, sync=False):
    "push code to a server (configure your own here)"

    c.run("git push --all")
    conn = Connection("trotsky")
    with conn.cd("src/pyborg-1up"):
        conn.run("git fetch")
        conn.run("git stash")
        conn.run("git pull")
        conn.run("git stash pop")
        if sync:
            conn.run("~/.local/bin/pipenv sync"
                     )  # they all use the same pipenv managed virtualenv
        if restart:
            units = " ".join([
                "pyborg_discord", "pyborg_http", "pyborg_twitter",
                "pyborg_mastodon"
            ])
            conn.run("sudo systemctl restart {}".format(units), pty=True)
            print("Restarted services.")
        print("Deploy Completed.")
コード例 #6
0
ファイル: test.py プロジェクト: taosdata/TDengine
        tdLog.info('stop All dnodes')

    if masterIp == "":
        host = '127.0.0.1'
    else:
        host = masterIp

    tdLog.info("Procedures for tdengine deployed in %s" % (host))
    if windows:
        tdCases.logSql(logSql)
        tdLog.info("Procedures for testing self-deployment")
        td_clinet = TDSimClient("C:\\TDengine")
        td_clinet.deploy()
        remote_conn = Connection("root@%s" % host)
        with remote_conn.cd(
                '/var/lib/jenkins/workspace/TDinternal/community/tests/pytest'
        ):
            remote_conn.run("python3 ./test.py")
        conn = taos.connect(host="%s" % (host), config=td_clinet.cfgDir)
        tdCases.runOneWindows(conn, fileName)
    else:
        tdDnodes.init(deployPath)
        tdDnodes.setTestCluster(testCluster)
        tdDnodes.setValgrind(valgrind)
        tdDnodes.stopAll()
        is_test_framework = 0
        key_word = 'tdCases.addLinux'
        try:
            if key_word in open(fileName).read():
                is_test_framework = 1
        except: