Skip to content

Commit

Permalink
Add option to build per rule playbook via build_product script
Browse files Browse the repository at this point in the history
  • Loading branch information
mildas committed Jun 28, 2024
1 parent 0514b2f commit b6d8f63
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit b6d8f63

Please sign in to comment.