Esempio n. 1
0
def AssertNPMInstalled():
    Logger.Info("Checking npm install path..", end = ' ')
    if not asserter.IsCommandExists("npm"):
        installhelper.InstallPrompt([ "npm" ])
    else:
        Logger.Success("OK")
        Logger.Info("Verifying latest version of NPM", end = ' ')

        installhelper.Install("npm", "npm")

        Logger.Success("OK")
Esempio n. 2
0
def AddToPath(syspath):
    if not IsAdmin():
        return Logger.Failed("You have no permission to modify the path.")

    Logger.Info("Trying to add {} to path..".format(syspath), end=' ')

    if not syspath in os.environ['PATH']:
        if sys.platform == "win32":
            path = os.pathsep + syspath
            oldpath = os.environ['PATH']
            Call('setx OLDPATH {}'.format(oldpath))
            Call('setx /M PATH "%PATH%;{}"'.format(path))
        return Logger.Success("OK")
    else:
        return Logger.Success("Path already defined, skipping")
Esempio n. 3
0
def DownloadAndInstallWindowsService(service, serviceName):
    conf = config.GetConfig()

    exeName = serviceName + '.exe'
    exePath = conf['temp-download-folder'] + '/' + serviceName + '/' + exeName

    if DownloadTo(service['url'], serviceName, exeName):
        Logger.Success("Download finished")
        Logger.Info("Installing {}.. Follow the instructions.".format(exeName),
                    end=' ')

        if InstallExe(exePath):
            return Logger.Success("Install finished")

        return Logger.Failed("Unexpected error during installation..")

    return Logger.Failed("Unexpected error during download..")
Esempio n. 4
0
def InstallMongoDB():
    conf = config.GetConfig()

    installdir = conf["install-root"] + 'mongodb'

    if not ash.AssertMongoInstalled():
        if not sh.AddToPathPrompt(installdir + '/bin'):
            Logger.Alert("Make sure to add this path to env")

    return Logger.Success("Mongo is installed in {0}.".format(installdir))
Esempio n. 5
0
def RegisterGitRemote(remote):

    if assertsh.AssertGitInstalled():
        if assertsh.AssertCall("git remote add origin {}".format(remote)):
            sh.Call("git remote -v")
            return Logger.Success("git setup complete on: {}".format(remote))
        else:
            return Logger.Failed("Could not add git remote: {}".format(remote))
    else:
        return Logger.Failed("Unexpected error during git installation.")
Esempio n. 6
0
def AssertGitInstalled():
    Logger.Info("Checking git install path..", end = ' '),
    if not ( asserter.IsCommandExists("git") ):
        return installhelper.InstallPrompt([ "git" ])
    else:
        return Logger.Success("OK");
Esempio n. 7
0
def AssertDockerInstalled():
    Logger.Info("Checking docker install path..", end = ' '),
    if not ( asserter.IsCommandExists("docker") ):
        return installhelper.InstallPrompt([ "docker" ])
    else:
        return Logger.Success("OK");
Esempio n. 8
0
def AssertMongoInstalled():
    Logger.Info("Checking mongodb install path..", end = ' '),
    if not ( asserter.IsCommandExists("mongo") or asserter.IsCommandExists("mongod") or asserter.IsCommandExists("mongos") ):
        return installhelper.InstallPrompt([ "mongodb" ])
    else:
        return Logger.Success("OK");
Esempio n. 9
0
def AssertNodeInstalled():
    Logger.Info("Checking node install path..", end = ' '),
    if not asserter.IsCommandExists("node"):
        return installhelper.InstallPrompt([ "nodejs", "npm" ])
    else:
        return Logger.Success("OK"),
Esempio n. 10
0
def AssertExpressInstalled():
    Logger.Info("Checking express install path..", end = ' ')
    if not asserter.IsCommandExists("express"):
        return installhelper.InstallPrompt([ "express-generator" ], 'npm')
    else:
        return Logger.Success(" OK")