Skip to content

Commit

Permalink
Merge pull request #285 from Yelp/remove-port-hacks
Browse files Browse the repository at this point in the history
Set MARATHON_PORT env variable in local-run
  • Loading branch information
nhandler committed Mar 3, 2016
2 parents 4eda5f0 + 30c190d commit d3f70c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions paasta_tools/cli/cmds/local_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def get_docker_run_cmd(memory, random_port, container_name, volumes, env, intera
cmd = ['docker', 'run']
for k, v in env.iteritems():
cmd.append('--env=\"%s=%s\"' % (k, v))
cmd.append('--env=MARATHON_PORT=%s' % random_port)
cmd.append('--env=HOST=%s' % hostname)
cmd.append('--env=MESOS_SANDBOX=/mnt/mesos/sandbox')
cmd.append('--memory=%dm' % memory)
Expand Down
1 change: 1 addition & 0 deletions tests/cli/test_cmds_local_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ def test_get_docker_run_cmd_interactive_false():
actual = get_docker_run_cmd(memory, random_port, container_name, volumes,
env, interactive, docker_hash, command, hostname)

assert any(['--env=MARATHON_PORT=%s' % random_port in arg for arg in actual])
assert '--memory=%dm' % memory in actual
assert any(['--publish=%s' % random_port in arg for arg in actual])
assert '--name=%s' % container_name in actual
Expand Down

0 comments on commit d3f70c4

Please sign in to comment.