Commit 7d35988b authored by Nicolas Wavrant's avatar Nicolas Wavrant

slaprunner: authorizes the automatically deploying of the Software Release

parent f26d41d7
...@@ -807,13 +807,14 @@ def readParameters(path): ...@@ -807,13 +807,14 @@ def readParameters(path):
else: else:
return "No such file or directory: %s" % path return "No such file or directory: %s" % path
def isSoftwareReleaseReady(config): def isSoftwareReleaseReady(config):
"""Return 1 if the Software Release has """Return 1 if the Software Release has
correctly been deployed, 0 if not, correctly been deployed, 0 if not,
and 2 if it is currently deploying""" and 2 if it is currently deploying"""
project = os.path.join(config['etc_dir'], '.project') project = os.path.join(config['etc_dir'], '.project')
if not os.path.exists(project): if not os.path.exists(project):
return "0"; return "0"
path = open(project, 'r').readline().strip() path = open(project, 'r').readline().strip()
software_name = path software_name = path
if software_name[-1] == '/': if software_name[-1] == '/':
...@@ -832,20 +833,24 @@ def isSoftwareReleaseReady(config): ...@@ -832,20 +833,24 @@ def isSoftwareReleaseReady(config):
else: else:
return "0" return "0"
def cloneDefaultGit(config): def cloneDefaultGit(config):
"""Test if the default git has been downloaded yet """Test if the default git has been downloaded yet
If not, download it in read-only mode""" If not, download it in read-only mode"""
default_git = os.path.join(config['runner_workdir'], 'project', 'default_repo') default_git = os.path.join(config['runner_workdir'],
'project', 'default_repo')
if not os.path.exists(default_git): if not os.path.exists(default_git):
data = {'path': default_git, data = {'path': default_git,
'repo': config['default_repo'], 'repo': config['default_repo'],
} }
cloneRepo(data) cloneRepo(data)
def buildAndRun(config): def buildAndRun(config):
runSoftwareWithLock(config) runSoftwareWithLock(config)
runInstanceWithLock(config) runInstanceWithLock(config)
def setupDefaultSR(config): def setupDefaultSR(config):
"""If a default_sr is in the parameters, """If a default_sr is in the parameters,
and no SR is deployed yet, setup it and no SR is deployed yet, setup it
......
...@@ -48,6 +48,9 @@ def before_request(): ...@@ -48,6 +48,9 @@ def before_request():
if request.path.startswith('/static'): if request.path.startswith('/static'):
return return
if request.path == '/isSRReady':
return
account = getSession(app.config) account = getSession(app.config)
if account: if account:
session['title'] = getProjectTitle(app.config) session['title'] = getProjectTitle(app.config)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment