Skip to content

Brave build refactor#168

Merged
idroz merged 12 commits intobravetools:masterfrom
Szubie:brave-build-refactor
Sep 30, 2022
Merged

Brave build refactor#168
idroz merged 12 commits intobravetools:masterfrom
Szubie:brave-build-refactor

Conversation

@Szubie
Copy link
Collaborator

@Szubie Szubie commented Sep 30, 2022

Addresses #138

This PR separates the build section of the Bravefile from the Service section. This means it's now possible to build an image from a Bravefile that doesn't have a Service section at all.

Major Changes:

  • Image field added to Build section of Bravefile - structure of <image_name>[/version][/arch] just like other Image fields.
  • When building image, unit name will be generated from image name (no longer requires unit Name field from Service section)
  • brave base no longer alters the name of the image being imported. It also applies same schema as above to extract metadata (<image_name>[/version][/arch]).

Minor:

  • Fixes to tests
  • Passing copies of bravefile/unitParams so host_api functions can mutate them safely.

Changes were largely made in a backwards compatible way - existing Bravefiles will continue to work.

If no Image value is provided in the build section, the Image field in the Service section will be used instead. Likewise, if no Image value is found in Service section during deploy, the build section Image field will be used - this means the Image field only needs to be defined once in the Bravefile, avoiding pointless repetition.

…seImageString` function is reused to extract metadata from provided image string (version and arch) - since public LXD image store uses same schema this works. Updates to use the new image naming schema, forgoing the version field.
…ed tests to fail if run on computer with LXD bridge on a different IP address range
…ned here will be used when building image - if not present the Image field from Service will be used instead.
…ge, use the Image defined in build section
…e from a Bravefile. Separating these steps clears the way for making the build and deploy sections of the Bravefile independent of each other.
…alues of args rather than take a pointer to avoid side-effects
@idroz idroz merged commit f0ab345 into bravetools:master Sep 30, 2022
@Szubie Szubie deleted the brave-build-refactor branch September 30, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants