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

Add option to fix build files issue. #140

Merged
merged 5 commits into from
Dec 2, 2023
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
1 change: 1 addition & 0 deletions changelogs/fragments/build_fixes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
bugfixes:
- Fixed an issue when ee_pull_collections_from_hub was set to true, and build_steps were not defined, an error was raised.
- Added an option of build_files to the ee definition. This will allow for files/folders to be copied to the working directory to be used for build files.
...
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ authors:
- Anshul Behl @anshulbehl
- Tom Page @Tompage1994
- David Danielsson @djdanielsson
repository: https://github.com/redhat-cop/controller_configuration/
issues: https://github.com/redhat-cop/controller_configuration//issues
repository: https://github.com/redhat-cop/ee_utilities/
issues: https://github.com/redhat-cop/ee_utilities//issues
build_ignore:
- galaxy.yml.j2
- release.yml
Expand Down
13 changes: 11 additions & 2 deletions roles/ee_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ It takes variables from the following sections the list variables section.
|`tag`||no|Tag to use when pushing the image.|
|`dependencies`|dict|no|This section allows you to describe any dependencies that will need to be installed into the final image. Reference [builder dependencies documentation](https://ansible.readthedocs.io/projects/builder/en/stable/definition/#dependencies), examples and our examples for its structure.|
|`build_steps`|dict|no|This section enables you to specify custom build commands for any build phase. Reference [builder build_steps documentation](https://ansible.readthedocs.io/projects/builder/en/stable/definition/#additional-build-steps), examples and our examples for its structure.|
|`build_items`|list|no|This is a list of files or folders that will be copied to the working directory for use with the build files. Example below.|
|`build_files`|dict|no|This section allows you to add any file to the build context directory. Reference [builder build_files documentation](https://ansible.readthedocs.io/projects/builder/en/stable/definition/#additional-build-files), examples and our examples for its structure.|
|`images`|dict|no|This section is a dictionary that is used to define the base image to be used. Reference [builder images documentation](https://ansible.readthedocs.io/projects/builder/en/stable/definition/#images), examples and our examples for its structure. This will override 'ee_base_image'.|
|`options`|dict|no|This section is a dictionary that contains keywords/options that can affect builder runtime functionality. Reference [builder options documentation](https://ansible.readthedocs.io/projects/builder/en/stable/definition/#options), examples and our examples for its structure.|
Expand Down Expand Up @@ -155,10 +156,18 @@ ansible-playbook playbook.yml
- infra.controller_configuration
- ansible.controller
- infra.ah_configuration
build_items:
- files/
- test.yml
build_files:
- src: files/stuff.txt
dest: folders
- src: test.yml
dest: folders
build_steps:
prepend_final:
- RUN whoami
- RUN cat /etc/os-release
- ADD _build/folders/stuff.txt /etc/ansible/stuff.txt
- ADD _build/folders/test.yml /etc/ansible/test.yml
append_final:
- RUN echo This is a post-install command!
roles:
Expand Down
10 changes: 10 additions & 0 deletions roles/ee_builder/tasks/00_build_ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
force: true
when: ee_update_base_images

- name: Copy files/folders to pull from for additional_build_files
ansible.builtin.copy:
src: '{{ item }}'
dest: '{{ ee_builder_dir | default(build_dir.path) }}/{{ item }}'
mode: '0655'
loop: '{{ __execution_environment_definition.build_items }}'
when:
- __execution_environment_definition.build_items is defined
- __execution_environment_definition.build_items|length

- name: Create ansible.cfg file if requested.
ansible.builtin.template:
src: ansible.cfg.j2
Expand Down
Loading