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

Make default Dockerfile embedded #2360

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

ssbarnea
Copy link
Member

From now on, creating a Dockerfile for docker/podman containers would
be optional. If the file is not present molecule would use its internal
template.

This ease maintenance of roles using molecule by having one less file
to create and update.

Those relying on custom containers are not affected, as this feature is
still present.

Newly created roles will not have Dockerfiles.

@ssbarnea ssbarnea force-pushed the fix/embed-dockerfile branch 3 times, most recently from f75047c to aad276f Compare October 11, 2019 16:40
From now on, creating a Dockerfile for docker/podman containers would
be optional. If the file is not present molecule would use its internal
version.

This ease maintenance of roles using molecule by having one less file
to create and update.

Those relying on custom containers are not affected, as this feature is
still present.

Newly created roles will not have Dockerfiles.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
@ssbarnea ssbarnea self-assigned this Oct 12, 2019
@ssbarnea ssbarnea changed the title WIP: Make default Dockerfile embedded Make default Dockerfile embedded Oct 12, 2019
@ssbarnea ssbarnea added the bump label Oct 12, 2019
Copy link
Contributor

@decentral1se decentral1se left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it but this looks good and is a useful change!

If you can move the vars into the ansible.py that would be better though, if it makes sense.

- name: Create Dockerfiles from image names
vars:
# TODO(ssbarnea): expose module dir so it can also be used by plugins
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about feeding it in from:

molecule_vars = {
'molecule_file': "{{ lookup('env', 'MOLECULE_FILE') }}",
'molecule_ephemeral_directory': "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}",
'molecule_scenario_directory': "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}",
'molecule_yml': "{{ lookup('file', molecule_file) | molecule_from_yaml }}",
'molecule_instance_config': "{{ lookup('env', 'MOLECULE_INSTANCE_CONFIG') }}",
'molecule_no_log': "{{ lookup('env', 'MOLECULE_NO_LOG') or not "
"molecule_yml.provisioner.log|default(False) | bool }}",
}

Does it work?

@ssbarnea ssbarnea merged commit 803e12d into ansible:master Oct 13, 2019
znerol added a commit to znerol/molecule-docker that referenced this pull request Oct 15, 2019
@ssbarnea ssbarnea deleted the fix/embed-dockerfile branch October 25, 2019 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants