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 build per rule playbook via build_product script #12105

Merged
merged 1 commit into from
Jun 28, 2024
Merged
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
9 changes: 9 additions & 0 deletions build_product
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ _arg_jobs="auto"
_arg_debug="off"
_arg_derivatives="off"
_arg_ansible_playbooks="on"
_arg_playbook_per_rule="off"
_arg_bash_scripts="on"
_arg_datastream_only="off"
_arg_profiling="off"
Expand All @@ -93,6 +94,7 @@ print_help()
printf '\t%s\n' "--debug, --no-debug: Make a debug build with draft profiles (off by default)"
printf '\t%s\n' "--derivatives, --no-derivatives: Also build derivatives of products if applicable (off by default)"
printf '\t%s\n' "--ansible-playbooks, --no-ansible-playbooks: Build Ansible Playbooks for every profile (on by default)"
printf '\t%s\n' "--playbook-per-rule, --no-playbook-per-rule: Build Ansible Playbooks for every rule (off by default)"
printf '\t%s\n' "--bash-scripts, --no-bash-scripts: Build Bash remediation scripts for every profile (on by default)"
printf '\t%s\n' "-t, --thin, --no-thin: Build thin data streams for each rule. Do not build any of the guides, tables, etc (off by default)"
printf '\t%s\n' "-r, --rule-id: Rule ID: Build a thin data stream with the specified rule. Do not build any of the guides, tables, etc (off by default)"
Expand Down Expand Up @@ -169,6 +171,10 @@ parse_commandline()
_arg_ansible_playbooks="on"
test "${1:0:5}" = "--no-" && _arg_ansible_playbooks="off"
;;
--no-playbook-per-rule|--playbook-per-rule)
_arg_playbook_per_rule="on"
test "${1:0:5}" = "--no-" && _arg_playbook_per_rule="off"
;;
--no-bash-scripts|--bash-scripts)
_arg_bash_scripts="on"
test "${1:0:5}" = "--no-" && _arg_bash_scripts="off"
Expand Down Expand Up @@ -425,6 +431,9 @@ set_no_derivatives_options
if [ "$_arg_ansible_playbooks" = off ] ; then
CMAKE_OPTIONS+=("-DSSG_ANSIBLE_PLAYBOOKS_ENABLED:BOOL=OFF")
fi
if [ "$_arg_playbook_per_rule" = on ] ; then
CMAKE_OPTIONS+=("-DSSG_ANSIBLE_PLAYBOOKS_PER_RULE_ENABLED:BOOL=ON")
fi
if [ "$_arg_bash_scripts" = off ] ; then
CMAKE_OPTIONS+=("-DSSG_BASH_SCRIPTS_ENABLED:BOOL=OFF")
fi
Expand Down
Loading