зеркало из https://github.com/microsoft/spinnaker.git
Update spring config loader for changes to subsystem spring config.
spinnaker.yml is now built into the components to look for which caused a conflict with injecting this resulting in files loaded out of order. Also modified refresh sources to monitor output rather than batching them to avoid potential deadlock on large changes.
This commit is contained in:
Родитель
927a02f468
Коммит
ee6789891a
|
@ -22,6 +22,7 @@ import sys
|
|||
|
||||
from spinnaker.run import run_and_monitor
|
||||
from spinnaker.run import run_quick
|
||||
from spinnaker.run import check_run_and_monitor
|
||||
from spinnaker.run import check_run_quick
|
||||
|
||||
|
||||
|
@ -167,9 +168,9 @@ class Refresher(object):
|
|||
sys.stderr.write(
|
||||
'WARNING: Updating {name} branch={branch}, *NOT* "master"\n'
|
||||
.format(name=name, branch=branch))
|
||||
check_run_quick('git -C {dir} pull origin {branch}'
|
||||
.format(dir=name, branch=branch),
|
||||
echo=True)
|
||||
check_run_and_monitor('git -C {dir} pull origin {branch}'
|
||||
.format(dir=name, branch=branch),
|
||||
echo=True)
|
||||
|
||||
def pull_from_upstream_if_master(self, repository):
|
||||
"""Pulls the master branch fromthe upstream repository.
|
||||
|
@ -190,9 +191,9 @@ class Refresher(object):
|
|||
return
|
||||
|
||||
print 'Pulling master {name} from upstream'.format(name=name)
|
||||
check_run_quick('git -C {name} pull upstream master'
|
||||
.format(name=name),
|
||||
echo=True)
|
||||
check_run_and_monitor('git -C {name} pull upstream master'
|
||||
.format(name=name),
|
||||
echo=True)
|
||||
|
||||
def push_to_origin_if_master(self, repository):
|
||||
"""Pushes the current master branch of the local repository to the origin.
|
||||
|
@ -253,11 +254,7 @@ class Refresher(object):
|
|||
root = '{dir}/config'.format(
|
||||
dir=os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')))
|
||||
home = os.path.join(os.environ['HOME'] + '/.spinnaker')
|
||||
return ('{root}/spinnaker.yml'
|
||||
',{home}/spinnaker-local.yml'
|
||||
',{root}/'
|
||||
',{home}/'
|
||||
.format(home=home, root=root))
|
||||
return ('{root}/,{home}/'.format(home=home, root=root))
|
||||
|
||||
def write_gradle_run_script(self, repository):
|
||||
"""Generate a dev_run.sh script for the local repository.
|
||||
|
|
|
@ -305,10 +305,7 @@ def inject_spring_config_location(options, subsystem):
|
|||
home = '/root/.spinnaker'
|
||||
new_content.append(value[0:offset])
|
||||
new_content.append('{quote}-Dspring.config.location='
|
||||
'{root}/spinnaker.yml'
|
||||
',{home}/spinnaker-local.yml'
|
||||
',{root}/'
|
||||
',{home}/{quote}'
|
||||
'{root}/,{home}/{quote}'
|
||||
.format(quote=quote, home=home, root=root))
|
||||
new_content.append(' ')
|
||||
|
||||
|
|
|
@ -188,16 +188,10 @@ class Runner(object):
|
|||
Returns:
|
||||
The pid of the subsystem once running.
|
||||
"""
|
||||
program = self.subsystem_to_program(subsystem)
|
||||
|
||||
if program == subsystem:
|
||||
print 'Starting {subsystem}'.format(subsystem=subsystem)
|
||||
else:
|
||||
print 'Starting {subsystem} as "{program}"'.format(
|
||||
subsystem=subsystem, program=program)
|
||||
print 'Starting {subsystem}'.format(subsystem=subsystem)
|
||||
|
||||
command = os.path.join(self.__installation.SUBSYSTEM_ROOT_DIR,
|
||||
program, 'bin', program)
|
||||
subsystem, 'bin', subsystem)
|
||||
base_log_path = os.path.join(self.__installation.LOG_DIR, subsystem)
|
||||
|
||||
if self.__new_bindings and subsystem == 'clouddriver':
|
||||
|
@ -339,7 +333,7 @@ class Runner(object):
|
|||
|
||||
job_map = {}
|
||||
for match in re_pid_and_subsystem.finditer(stdout):
|
||||
name = self.program_to_subsystem(match.groups()[1])
|
||||
name = match.groups()[1]
|
||||
pid = int(match.groups()[0])
|
||||
job_map[name] = pid
|
||||
|
||||
|
@ -603,18 +597,6 @@ Proceeding anyway.
|
|||
options = parser.parse_args()
|
||||
runner.run(options)
|
||||
|
||||
def program_to_subsystem(self, program):
|
||||
if program == 'front50-web':
|
||||
return 'front50'
|
||||
else:
|
||||
return program
|
||||
|
||||
def subsystem_to_program(self, subsystem):
|
||||
if subsystem == 'front50':
|
||||
return 'front50-web'
|
||||
else:
|
||||
return subsystem
|
||||
|
||||
@staticmethod
|
||||
def check_java_version():
|
||||
"""Ensure that we will be running the right version of Java.
|
||||
|
|
Загрузка…
Ссылка в новой задаче