mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-07 13:41:21 +00:00
#N/A Implicitly prefix containers names
This commit is contained in:
parent
e1416a0127
commit
174ada054d
@ -2,7 +2,7 @@ import pytest
|
|||||||
from tests.functional.plots import with_confirmation, without_confirmation
|
from tests.functional.plots import with_confirmation, without_confirmation
|
||||||
from tests.functional.utils import spawn, functional
|
from tests.functional.utils import spawn, functional
|
||||||
|
|
||||||
containers = [('thefuck/ubuntu-python3-bash', '''
|
containers = [('ubuntu-python3-bash', '''
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yy python3 python3-pip python3-dev
|
RUN apt-get install -yy python3 python3-pip python3-dev
|
||||||
@ -10,7 +10,7 @@ RUN pip3 install -U setuptools
|
|||||||
RUN ln -s /usr/bin/pip3 /usr/bin/pip
|
RUN ln -s /usr/bin/pip3 /usr/bin/pip
|
||||||
CMD ["/bin/bash"]
|
CMD ["/bin/bash"]
|
||||||
'''),
|
'''),
|
||||||
('thefuck/ubuntu-python2-bash', '''
|
('ubuntu-python2-bash', '''
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yy python python-pip python-dev
|
RUN apt-get install -yy python python-pip python-dev
|
||||||
|
@ -2,7 +2,7 @@ import pytest
|
|||||||
from tests.functional.plots import with_confirmation, without_confirmation
|
from tests.functional.plots import with_confirmation, without_confirmation
|
||||||
from tests.functional.utils import spawn, functional
|
from tests.functional.utils import spawn, functional
|
||||||
|
|
||||||
containers = [('thefuck/ubuntu-python3-bash', '''
|
containers = [('ubuntu-python3-bash', '''
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yy python3 python3-pip python3-dev fish
|
RUN apt-get install -yy python3 python3-pip python3-dev fish
|
||||||
@ -10,7 +10,7 @@ RUN pip3 install -U setuptools
|
|||||||
RUN ln -s /usr/bin/pip3 /usr/bin/pip
|
RUN ln -s /usr/bin/pip3 /usr/bin/pip
|
||||||
CMD ["/usr/bin/fish"]
|
CMD ["/usr/bin/fish"]
|
||||||
'''),
|
'''),
|
||||||
('thefuck/ubuntu-python2-bash', '''
|
('ubuntu-python2-bash', '''
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yy python python-pip python-dev fish
|
RUN apt-get install -yy python python-pip python-dev fish
|
||||||
|
@ -2,7 +2,7 @@ import pytest
|
|||||||
from tests.functional.utils import spawn, functional
|
from tests.functional.utils import spawn, functional
|
||||||
from tests.functional.plots import with_confirmation, without_confirmation
|
from tests.functional.plots import with_confirmation, without_confirmation
|
||||||
|
|
||||||
containers = [('thefuck/ubuntu-python3-zsh', '''
|
containers = [('ubuntu-python3-zsh', '''
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yy python3 python3-pip python3-dev zsh
|
RUN apt-get install -yy python3 python3-pip python3-dev zsh
|
||||||
@ -10,7 +10,7 @@ RUN pip3 install -U setuptools
|
|||||||
RUN ln -s /usr/bin/pip3 /usr/bin/pip
|
RUN ln -s /usr/bin/pip3 /usr/bin/pip
|
||||||
CMD ["/bin/zsh"]
|
CMD ["/bin/zsh"]
|
||||||
'''),
|
'''),
|
||||||
('thefuck/ubuntu-python2-zsh', '''
|
('ubuntu-python2-zsh', '''
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -yy python python-pip python-dev zsh
|
RUN apt-get install -yy python python-pip python-dev zsh
|
||||||
|
@ -17,12 +17,13 @@ def build_container(tag, dockerfile):
|
|||||||
file.write(dockerfile)
|
file.write(dockerfile)
|
||||||
if subprocess.call(['docker', 'build', '--tag={}'.format(tag), tmpdir],
|
if subprocess.call(['docker', 'build', '--tag={}'.format(tag), tmpdir],
|
||||||
cwd=root) != 0:
|
cwd=root) != 0:
|
||||||
raise Exception("Can't build container")
|
raise Exception("Can't build a container")
|
||||||
shutil.rmtree(tmpdir)
|
shutil.rmtree(tmpdir)
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def spawn(tag, dockerfile):
|
def spawn(tag, dockerfile):
|
||||||
|
tag = 'thefuck/{}'.format(tag)
|
||||||
build_container(tag, dockerfile)
|
build_container(tag, dockerfile)
|
||||||
proc = pexpect.spawnu(
|
proc = pexpect.spawnu(
|
||||||
'docker run --volume {}:/src --tty=true --interactive=true {}'.format(root, tag))
|
'docker run --volume {}:/src --tty=true --interactive=true {}'.format(root, tag))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user