generated from canonical/starbase
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: do variable expansion when loading project (#101)
Perform environment expansion on the yaml dict that is used to create the Project. This expands variables like CRAFT_PROJECT_VERSION (and the many more provided by craft-parts). Also add a "hook" for app-specific modifications to the yaml dict in the form of the `_extra_yaml_transform()` method (a no-op in the base Application).
- Loading branch information
Showing
7 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Packed package.tar.zst |
14 changes: 14 additions & 0 deletions
14
tests/integration/data/valid_projects/environment/testcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: environment-project | ||
summary: A project with environment variables | ||
version: 1.2.3 | ||
base: ["ubuntu", "22.04"] | ||
|
||
parts: | ||
my-part: | ||
plugin: nil | ||
override-build: | | ||
target_file=${CRAFT_PART_INSTALL}/variables.yaml | ||
touch $target_file | ||
echo "project_name: \"${CRAFT_PROJECT_NAME}\"" >> $target_file | ||
echo "project_dir: \"${CRAFT_PROJECT_DIR}\"" >> $target_file | ||
echo "project_version: \"${CRAFT_PROJECT_VERSION}\"" >> $target_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters