mirror of
https://github.com/certbot/certbot.git
synced 2026-08-04 12:13:34 +02:00
Merge pull request #9926 from certbot/docker-compose-v2
Switch to using docker compose v2
This commit is contained in:
@@ -69,7 +69,7 @@ def _setup_primary_node(config):
|
|||||||
Setup the environment for integration tests.
|
Setup the environment for integration tests.
|
||||||
|
|
||||||
This function will:
|
This function will:
|
||||||
- check runtime compatibility (Docker, docker-compose, Nginx)
|
- check runtime compatibility (Docker, docker compose, Nginx)
|
||||||
- create a temporary workspace and the persistent GIT repositories space
|
- create a temporary workspace and the persistent GIT repositories space
|
||||||
- configure and start a DNS server using Docker, if configured
|
- configure and start a DNS server using Docker, if configured
|
||||||
- configure and start paralleled ACME CA servers using Docker
|
- configure and start paralleled ACME CA servers using Docker
|
||||||
@@ -89,10 +89,11 @@ def _setup_primary_node(config):
|
|||||||
'boulder, but is not installed or not available for current user.')
|
'boulder, but is not installed or not available for current user.')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(['docker-compose', '-v'], stderr=subprocess.STDOUT)
|
subprocess.check_output(['docker', 'compose', 'ls'], stderr=subprocess.STDOUT)
|
||||||
except (subprocess.CalledProcessError, OSError):
|
except (subprocess.CalledProcessError, OSError):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'Error: docker-compose is required in PATH to launch the integration tests, '
|
'Error: A version of Docker with the "compose" subcommand '
|
||||||
|
'is required in PATH to launch the integration tests, '
|
||||||
'but is not installed or not available for current user.'
|
'but is not installed or not available for current user.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -205,9 +205,9 @@ class ACMEServer:
|
|||||||
f.write(json.dumps(config, indent=2, separators=(',', ': ')))
|
f.write(json.dumps(config, indent=2, separators=(',', ': ')))
|
||||||
|
|
||||||
# This command needs to be run before we try and terminate running processes because
|
# This command needs to be run before we try and terminate running processes because
|
||||||
# docker-compose up doesn't always respond to SIGTERM. See
|
# docker compose up doesn't always respond to SIGTERM. See
|
||||||
# https://github.com/certbot/certbot/pull/9435.
|
# https://github.com/certbot/certbot/pull/9435.
|
||||||
self._register_preterminate_cmd(['docker-compose', 'down'], cwd=instance_path)
|
self._register_preterminate_cmd(['docker', 'compose', 'down'], cwd=instance_path)
|
||||||
# Boulder docker generates build artifacts owned by root with 0o744 permissions.
|
# Boulder docker generates build artifacts owned by root with 0o744 permissions.
|
||||||
# If we started the acme server from a normal user that has access to the Docker
|
# If we started the acme server from a normal user that has access to the Docker
|
||||||
# daemon, this user will not be able to delete these artifacts from the host.
|
# daemon, this user will not be able to delete these artifacts from the host.
|
||||||
@@ -217,7 +217,7 @@ class ACMEServer:
|
|||||||
'-rf', '/workspace/boulder'])
|
'-rf', '/workspace/boulder'])
|
||||||
try:
|
try:
|
||||||
# Launch the Boulder server
|
# Launch the Boulder server
|
||||||
self._launch_process(['docker-compose', 'up', '--force-recreate'], cwd=instance_path)
|
self._launch_process(['docker', 'compose', 'up', '--force-recreate'], cwd=instance_path)
|
||||||
|
|
||||||
# Wait for the ACME CA server to be up.
|
# Wait for the ACME CA server to be up.
|
||||||
print('=> Waiting for boulder instance to respond...')
|
print('=> Waiting for boulder instance to respond...')
|
||||||
@@ -236,7 +236,7 @@ class ACMEServer:
|
|||||||
# If we failed to set up boulder, print its logs.
|
# If we failed to set up boulder, print its logs.
|
||||||
print('=> Boulder setup failed. Boulder logs are:')
|
print('=> Boulder setup failed. Boulder logs are:')
|
||||||
process = self._launch_process([
|
process = self._launch_process([
|
||||||
'docker-compose', 'logs'], cwd=instance_path, force_stderr=True
|
'docker', 'compose', 'logs'], cwd=instance_path, force_stderr=True
|
||||||
)
|
)
|
||||||
process.wait(MAX_SUBPROCESS_WAIT)
|
process.wait(MAX_SUBPROCESS_WAIT)
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ Running automated integration tests
|
|||||||
|
|
||||||
Generally it is sufficient to open a pull request and let Github and Azure Pipelines run
|
Generally it is sufficient to open a pull request and let Github and Azure Pipelines run
|
||||||
integration tests for you. However, you may want to run them locally before submitting
|
integration tests for you. However, you may want to run them locally before submitting
|
||||||
your pull request. You need Docker and docker-compose installed and working.
|
your pull request. You need Docker installed and working.
|
||||||
|
|
||||||
The tox environment `integration` will setup `Pebble`_, the Let's Encrypt ACME CA server
|
The tox environment `integration` will setup `Pebble`_, the Let's Encrypt ACME CA server
|
||||||
for integration testing, then launch the Certbot integration tests.
|
for integration testing, then launch the Certbot integration tests.
|
||||||
|
|||||||
Reference in New Issue
Block a user