feat(add dockerfile_path to build api): added in a dockerfile to specify path

### Description of Changes

  this allows people to specify a context and a dockerfile path
This commit is contained in:
Charlton Austin 2017-03-30 14:12:32 -04:00
parent 3a72a8ef9c
commit 63a2f0c14b
2 changed files with 20 additions and 2 deletions

View file

@ -8,6 +8,11 @@ from endpoints.api.build import RepositoryBuildList
({'context': '/some_context'}, '/some_context/Dockerfile', '/some_context'),
({'subdirectory': 'some_context'}, 'some_context/Dockerfile', 'some_context'),
({'subdirectory': 'some_context/'}, 'some_context/Dockerfile', 'some_context/'),
({'dockerfile_path': 'some_context/Dockerfile'}, 'some_context/Dockerfile', 'some_context'),
({'dockerfile_path': 'some_context/Dockerfile', 'context': '/'}, 'some_context/Dockerfile', '/'),
({'dockerfile_path': 'some_context/Dockerfile',
'context': '/',
'subdirectory': 'slime'}, 'some_context/Dockerfile', '/'),
])
def test_extract_dockerfile_args(request_json, subdir, context):
actual_context, actual_subdir = RepositoryBuildList.get_dockerfile_context(request_json)