-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpmbuild: specify snippets to mock config via copr-rpmbuild config file
This allows us to specify tpm fs size to rpmbuild in order to be able to automatically generate its size for performance builders. See #3268
- Loading branch information
Showing
10 changed files
with
121 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
# Configure special mock configuration snippets per given set of tags. | ||
# tags_to_mock_snippet: | ||
# - tagset: | ||
# - on_demand_powerful | ||
# - arch_x86_64 | ||
# snippet: config_opts['plugin_conf']['tmpfs_opts']['max_fs_size'] = '280g' | ||
# - tagset: | ||
# - on_demand_powerful | ||
# - something | ||
# snippet: | | ||
# cute | ||
# multiline | ||
# snippet |
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,29 @@ | ||
""" | ||
Configuration class for copr-rpmbuild | ||
""" | ||
|
||
import yaml | ||
|
||
|
||
CONFIG_PATH = "/etc/copr-rpmbuild/copr-rpmbuild.yml" | ||
|
||
|
||
class Config: | ||
""" | ||
Configuration class for copr-rpmbuild | ||
""" | ||
def __init__(self): | ||
self.tags_to_mock_snippet = [] | ||
|
||
def load_config(self): | ||
""" | ||
Load configuration from the config file | ||
""" | ||
config_data = {} | ||
try: | ||
with open(CONFIG_PATH, "r", encoding="utf-8") as file: | ||
config_data = yaml.safe_load(file) or {} | ||
except FileNotFoundError: | ||
pass | ||
|
||
self.tags_to_mock_snippet = config_data.get("tags_to_mock_snippet", []) |
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
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