Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made base image fully configurable #2385

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions molecule/test/functional/docker/test_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,8 @@ def test_command_test_builds_local_molecule_image(
scenario_to_test, with_scenario, scenario_name, driver_name
):
try:
version = os.environ.get('TEST_CENTOS_VERSION', 7)
cmd = sh.docker.bake(
'rmi', 'molecule_local/centos:{}'.format(version), '--force'
)
image = os.environ.get('TEST_BASE_IMAGE', "pycontribs/centos:7")
cmd = sh.docker.bake('rmi', 'molecule_local/{}'.format(image), '--force')
pytest.helpers.run_command(cmd)
except sh.ErrorReturnCode:
pass
Expand Down
2 changes: 1 addition & 1 deletion molecule/test/resources/molecule_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lint:
name: yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
lint:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
docker_container:
name: delegated-instance-docker
hostname: delegated-instance-docker
image: molecule_local/centos:${TEST_CENTOS_VERSION}
image: molecule_local/${TEST_BASE_IMAGE}
recreate: false
log_driver: json-file
command: sleep infinity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
command: /sbin/init
privileged: true
provisioner:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
networks:
- name: foo
- name: bar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
networks:
- name: foo
- name: bar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ lint:
config-file: ../../../resources/.yamllint
platforms:
- name: instance-1
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
groups:
- foo
- bar
buildargs:
testarg: this_is_a_test
- name: instance-2
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
groups:
- foo
- baz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
groups:
- example
children:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
groups:
- example
children:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: $INSTANCE_NAME
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
command: /sbin/init
privileged: true
provisioner:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
playbooks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
config-file: ../../resources/.yamllint
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
provisioner:
name: ansible
config_options:
Expand Down
2 changes: 1 addition & 1 deletion molecule/test/unit/model/v2/test_pre_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _model_molecule_env_errors_section_data():
name: $MOLECULE_LINT_NAME
platforms:
- name: instance
image: centos:${TEST_CENTOS_VERSION}
image: ${TEST_BASE_IMAGE}
networks:
- name: foo
- name: bar
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ passenv = *
setenv =
ANSIBLE_CALLABLE_WHITELIST={env:ANSIBLE_CALLABLE_WHITELIST:timer,profile_roles}
PYTHONDONTWRITEBYTECODE=1
TEST_CENTOS_VERSION=7
TEST_BASE_IMAGE=pycontribs/centos:7
# -n auto used only on unit as is not supported by functional yet
unit: PYTEST_ADDOPTS=molecule/test/unit/ --cov={toxinidir}/molecule/ --no-cov-on-fail {env:PYTEST_ADDOPTS:-n auto}
functional: PYTEST_ADDOPTS=molecule/test/functional/ {env:PYTEST_ADDOPTS:}
Expand Down