summaryrefslogtreecommitdiffstats
path: root/gitautodeploy/cli/config.py
diff options
context:
space:
mode:
authorTorben <torben.letorbi@gmail.com>2016-07-08 15:52:42 +0200
committerTorben <torben.letorbi@gmail.com>2016-07-08 15:52:42 +0200
commit7720ec0cf45bb0b44e3e5b56116545237918d448 (patch)
treee94a9f2b7f0b8a0920e0192ab4e5b48ca4cbb266 /gitautodeploy/cli/config.py
parent2e25cb624a41143bebaea6ec59cce2a2b3b3c3a3 (diff)
downloadGit-Auto-Deploy-7720ec0cf45bb0b44e3e5b56116545237918d448.zip
Git-Auto-Deploy-7720ec0cf45bb0b44e3e5b56116545237918d448.tar.gz
Git-Auto-Deploy-7720ec0cf45bb0b44e3e5b56116545237918d448.tar.bz2
Move config checks into cli/config module
Diffstat (limited to 'gitautodeploy/cli/config.py')
-rw-r--r--gitautodeploy/cli/config.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/gitautodeploy/cli/config.py b/gitautodeploy/cli/config.py
index b23135f..302bcae 100644
--- a/gitautodeploy/cli/config.py
+++ b/gitautodeploy/cli/config.py
@@ -246,6 +246,16 @@ def init_config(config):
for repo_config in config['repositories']:
+ # Only clone repositories with a configured path
+ if 'url' not in repo_config:
+ logger.critical("Repository has no configured URL")
+ return 1
+
+ # Only clone repositories with a configured path
+ if 'path' not in repo_config:
+ logger.critical("Repository has no configured path")
+ return 2
+
# Setup branch if missing
if 'branch' not in repo_config:
repo_config['branch'] = "master"
@@ -301,7 +311,7 @@ def init_config(config):
filter['pull_request'] = True
- return config
+ return 0
def get_repo_config_from_environment():
"""Look for repository config in any defined environment variables. If
@@ -332,4 +342,4 @@ def get_repo_config_from_environment():
if 'GAD_REPO_DEPLOY' in os.environ:
repo_config['deploy'] = os.environ['GAD_REPO_DEPLOY']
- return repo_config \ No newline at end of file
+ return repo_config