def getWorkspace(): """ :raises: infrastructure.utilities.exceptions.CommandFailedError if the workspace env variable isn't set and you are running from outside of a git repo or the git command to find your current root folder fails. :returns: The value of the `WORKSPACE` environment variable, or the root folder of the products repo. This assumes you are executing from any folder within the Products repo. """ workspace = None if "WORKSPACE" in os.environ: workspace = os.environ["WORKSPACE"] else: workspace = getGitRootFolder() return workspace
def getWorkspace(logger): """ Returns the path to the workspace in which things are being built :param logger: logger for additional debug info :raises infrastructure.utilities.exceptions.CommandFailedError: if the workspace env variable isn't set and you are running from outside of a git repo or the git command to find your current root folder fails. :returns: The value of the `WORKSPACE` environment variable, or the root folder of the current repo. This should be a folder path. Examples: - /opt/numenta/jenkins/workspace/htm-it-product-pipeline - ~/nta/numenta-apps :rtype: str """ workspace = None if "WORKSPACE" in os.environ: workspace = os.environ["WORKSPACE"] else: workspace = getGitRootFolder(logger=logger) return workspace
def getWorkspace(logger): """ Returns the path to the workspace in which things are being built :param logger: logger for additional debug info :raises infrastructure.utilities.exceptions.CommandFailedError: if the workspace env variable isn't set and you are running from outside of a git repo or the git command to find your current root folder fails. :returns: The value of the `WORKSPACE` environment variable, or the root folder of the current repo. This should be a folder path. Examples: - /opt/numenta/jenkins/workspace/htm-it-product-pipeline - ~/nta/numenta-apps :rtype: str """ workspace = None if "WORKSPACE" in os.environ: workspace = os.environ["WORKSPACE"] else: workspace = getGitRootFolder(logger=logger) return workspace
import yaml from infrastructure.utilities import git from infrastructure.utilities.jenkins import (createOrReplaceResultsDir, createOrReplaceArtifactsDir) from infrastructure.utilities import logger as log from infrastructure.utilities import s3 from infrastructure.utilities.env import addNupicCoreToEnv from infrastructure.utilities.exceptions import (CommandFailedError, NupicBuildFailed, PipelineError) from infrastructure.utilities.path import changeToWorkingDir from infrastructure.utilities.cli import runWithOutput NUPIC_CORE_REMOTE = "[email protected]:numenta/nupic.core.git" SCRIPTS_DIR = os.path.join(git.getGitRootFolder(), "nupic-pipeline", "scripts") ARTIFACTS_DIR = createOrReplaceArtifactsDir() DOXYFILE = "docs/Doxyfile" INIT_FILE = "nupic/__init__.py" VERSION_FILE = "VERSION" g_config = yaml.load( resource_stream(__name__, "../../../conf/nupic/config.yaml")) def fetchNuPIC(env, buildWorkspace, nupicRemote, nupicBranch, nupicSha, logger): """ This method clones NuPIC repo if it is not present and checks out to required nupicBranch
) from infrastructure.utilities import logger as log from infrastructure.utilities import s3 from infrastructure.utilities.env import addNupicCoreToEnv from infrastructure.utilities.exceptions import ( CommandFailedError, NupicBuildFailed, PipelineError ) from infrastructure.utilities.path import changeToWorkingDir from infrastructure.utilities.cli import runWithOutput NUPIC_CORE_REMOTE = "[email protected]:numenta/nupic.core.git" SCRIPTS_DIR = os.path.join(git.getGitRootFolder(), "nupic-pipeline", "scripts") ARTIFACTS_DIR = createOrReplaceArtifactsDir() g_config = yaml.load( resource_stream(__name__, "../../../conf/nupic/config.yaml")) def fetchNuPIC(env, buildWorkspace, nupicRemote, nupicBranch, nupicSha, logger): """ This method clones NuPIC repo if it is not present and checks out to required nupicBranch :param env: The environment which will be used before building. :param buildWorkspace: The workspace where NuPIC should be built :param nupicRemote: URL for NuPIC remote repository