mirror of
https://github.com/IEEE-SB-Passau/pelican-deployment-system.git
synced 2017-09-06 16:35:38 +02:00
fix repo creation
This commit is contained in:
@@ -57,6 +57,9 @@ class DeploymentRunner:
|
||||
self._update_build_repository()
|
||||
|
||||
def _update_build_repository(self):
|
||||
if not self.build_repo_path.exists():
|
||||
self.build_repo_path.mkdir(parents=True)
|
||||
|
||||
repo = Repo(str(self.build_repo_path))
|
||||
if not repo.is_repo():
|
||||
if self.build_repo_path.is_dir() and \
|
||||
@@ -67,8 +70,9 @@ class DeploymentRunner:
|
||||
raise RuntimeException(("non-empty {} exists but not a"
|
||||
"valid git repository!").format(self.build_repo_path))
|
||||
else:
|
||||
log.info("Build repository %s not there, cloneing", e)
|
||||
result = repo.clone("--branch", "self.git_branch",
|
||||
log.info("Build repository %s not there, cloning",
|
||||
self.build_repo_path)
|
||||
result = repo.clone("--branch", self.git_branch,
|
||||
"--depth", "1", self.clone_url, ".")
|
||||
log_git(result)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import errno
|
||||
import shlex
|
||||
from collections import namedtuple
|
||||
from subprocess import Popen, PIPE
|
||||
@@ -13,6 +14,9 @@ class GitCommandError(Exception):
|
||||
|
||||
class Repo:
|
||||
def __init__(self, repo_dir, git_cmd="git", default_timeout=None):
|
||||
if not os.path.exists(repo_dir):
|
||||
raise FileNotFoundError(errno.ENOENT, "Path, does not exist",
|
||||
repo_dir)
|
||||
self.repo_dir = repo_dir
|
||||
self.git_cmd = git_cmd
|
||||
self.default_timeout = default_timeout
|
||||
|
||||
Reference in New Issue
Block a user