mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-02 06:45:45 +00:00
chore(ci): ⬆️ porting python 2.7 code to python 3.9
This commit is contained in:
committed by
Nicolas Duchon
parent
fe79dd4cd3
commit
950a28f5ea
@ -4,7 +4,7 @@ import logging
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.yield_fixture(scope="module")
|
||||
@pytest.fixture(scope="module")
|
||||
def nginx_tmpl():
|
||||
"""
|
||||
pytest fixture which extracts the the nginx config template from
|
||||
@ -13,14 +13,18 @@ def nginx_tmpl():
|
||||
script_dir = os.path.dirname(__file__)
|
||||
logging.info("extracting nginx.tmpl from nginxproxy/nginx-proxy:test")
|
||||
docker_client = docker.from_env()
|
||||
print(docker_client.containers.run(
|
||||
image='nginxproxy/nginx-proxy:test',
|
||||
remove=True,
|
||||
volumes=['{current_dir}:{current_dir}'.format(current_dir=script_dir)],
|
||||
entrypoint='sh',
|
||||
command='-xc "cp /app/nginx.tmpl {current_dir} && chmod 777 {current_dir}/nginx.tmpl"'.format(
|
||||
current_dir=script_dir),
|
||||
stderr=True))
|
||||
print(
|
||||
docker_client.containers.run(
|
||||
image="nginxproxy/nginx-proxy:test",
|
||||
remove=True,
|
||||
volumes=["{current_dir}:{current_dir}".format(current_dir=script_dir)],
|
||||
entrypoint="sh",
|
||||
command='-xc "cp /app/nginx.tmpl {current_dir} && chmod 777 {current_dir}/nginx.tmpl"'.format(
|
||||
current_dir=script_dir
|
||||
),
|
||||
stderr=True,
|
||||
)
|
||||
)
|
||||
yield
|
||||
logging.info("removing nginx.tmpl")
|
||||
os.remove(os.path.join(script_dir, "nginx.tmpl"))
|
||||
|
Reference in New Issue
Block a user