mirror of
https://github.com/elastic/logstash.git
synced 2025-06-28 17:53:28 -04:00
build docker images from logstash repo (#10603)
introduces two rake tasks: `rake artifact:docker_oss` and `rake artifact:docker`, which will create the docker images of the OSS and non OSS packages. These tasks depend on the tar artifacts being built. Also `rake artifact:all` has been modified to also call these two tasks. most code was moved from https://github.com/elastic/logstash-docker/
This commit is contained in:
parent
bb8d4fbc19
commit
dc5db673ee
33 changed files with 1088 additions and 2 deletions
25
docker/tests/conftest.py
Normal file
25
docker/tests/conftest.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
from subprocess import run
|
||||
import pytest
|
||||
from .constants import container_name, version
|
||||
import docker
|
||||
|
||||
docker_engine = docker.from_env()
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
"""Customize testinfra with config options via cli args"""
|
||||
# Let us specify which docker-compose-(image_flavor).yml file to use
|
||||
parser.addoption('--image-flavor', action='store', default='full',
|
||||
help='Docker image flavor; the suffix used in docker-compose-<flavor>.yml')
|
||||
|
||||
|
||||
@pytest.fixture(scope='session', autouse=True)
|
||||
def start_container():
|
||||
image = 'docker.elastic.co/logstash/logstash-%s:%s' % (pytest.config.getoption('--image-flavor'), version)
|
||||
docker_engine.containers.run(image, name=container_name, detach=True, stdin_open=False)
|
||||
|
||||
|
||||
def pytest_unconfigure(config):
|
||||
container = docker_engine.containers.get(container_name)
|
||||
container.stop()
|
||||
container.remove()
|
Loading…
Add table
Add a link
Reference in a new issue