Giter Club home page Giter Club logo

Comments (3)

kdelee avatar kdelee commented on August 21, 2024

@AlanCoding example given in issue has a couple problems:

  1. #50 is not done, including the list of system dependencies causes a traceback, but will delay looking at that until the issue is closed
  2. looks like code can't handle the multiline string you are using in your example, it wants a prepend and/or append section
cat execution-environment.yml 
---
version: 1
dependencies:
  python: requirements.txt

additional_build_steps: |
  RUN touch foo
  ENV ELIJAH_VAR=elijah
 ansible-builder build
requirements.txt
requirements.txt
Traceback (most recent call last):
  File "/home/elijah/.cache/pypoetry/virtualenvs/ansible-builder-d47oRQeY-py3.8/bin/ansible-builder", line 11, in <module>
    load_entry_point('ansible-builder', 'console_scripts', 'ansible-builder')()
  File "/home/elijah/sfw/ansible/ansible-builder/ansible_builder/cli.py", line 20, in run
    if action():
  File "/home/elijah/sfw/ansible/ansible-builder/ansible_builder/main.py", line 57, in build
    self.containerfile.prepare_prepended_steps()
  File "/home/elijah/sfw/ansible/ansible-builder/ansible_builder/main.py", line 205, in prepare_prepended_steps
    prepended_steps = additional_prepend_steps.get('prepend')
AttributeError: 'str' object has no attribute 'get'

looks like need to gracefully reject a additional_build_steps section that is not a dictionary

put up a PR with possible error message enhancement

from ansible-builder.

kdelee avatar kdelee commented on August 21, 2024

now testing w/ proper syntax, and its working for me:

---
version: 1
dependencies:
  python: requirements.txt

additional_build_steps:
  prepend: |
    ENV ELIJAH_VAR=elijah

building the image and then inspecting the environment shows my environment variable was set.

This is another case for our basic integration tests for when we get those added to the repo

from ansible-builder.

AlanCoding avatar AlanCoding commented on August 21, 2024

Sorry about the example, it has been a moving target. The syntax has evolved over time. You can still do:

---
version: 1
dependencies:
  python: requirements.txt
  system: bindep.txt

additional_build_steps:
  prepend: |
    ENV ELIJAH_VAR=elijah

And the last piece of #50 is integrating bindep.txt from collections into the mix, which is the current item I'm trying to get cleared up and finished. If you do it this way, the bindep.txt file next to your execution-environment.yml file can list git as an rpm type dependency.

from ansible-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.