Skip to content

Commit

Permalink
Tweaks to component filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz committed Jun 10, 2021
1 parent a3274fc commit 62728fd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bonfire/bonfire.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ def _validate_set_image_tag(ctx, param, value):
"--component",
"-C",
"component_filter",
help="Component that should be processed (default: all components)",
help="Specific component(s) that should be processed (default: all)",
type=str,
multiple=True,
)
),
]


Expand Down
6 changes: 5 additions & 1 deletion bonfire/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,12 @@ def _process_app(self, app_name):
app_cfg = self._get_app_config(app_name)
for component in app_cfg["components"]:
component_name = component["name"]
log.debug("app '%s' has component '%s'", app_name, component_name)
if self.component_filter and component_name not in self.component_filter:
log.debug("skipping component '%s'", component_name)
log.debug(
"skipping component '%s', not found in --component filter", component_name
)
self.processed_components.add(component_name)
continue
self._process_component(component_name)

Expand Down
4 changes: 2 additions & 2 deletions cicd/_common_deploy_logic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#APP_NAME="myapp" # name of app-sre "application" folder this component lives in
#COMPONENT_NAME="mycomponent" # name of app-sre "resourceTemplate" in deploy.yaml for this component
#IMAGE="quay.io/cloudservices/mycomponent" # image that this application uses
#COMPONENTS="component1 component2" # components to deploy (optional)
#COMPONENTS="component1 component2" # specific components to deploy (optional, default: all)

# Env vars set by 'bootstrap.sh':
#IMAGE_TAG="abcd123" # image tag for the PR being tested
Expand Down Expand Up @@ -72,5 +72,5 @@ if [ ! -z "$COMPONENTS" ]; then
for c in $COMPONENTS; do
options="$options --component $c"
done
export COMPONENTS=$options
export COMPONENTS_ARG=$options
fi
2 changes: 1 addition & 1 deletion cicd/deploy_ephemeral_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bonfire process \
--set-image-tag $IMAGE=$IMAGE_TAG \
--no-get-dependencies \
--namespace $NAMESPACE \
$COMPONENTS | oc apply -f - -n $NAMESPACE
$COMPONENTS_ARG | oc apply -f - -n $NAMESPACE

bonfire namespace wait-on-resources $NAMESPACE --db-only

Expand Down
2 changes: 1 addition & 1 deletion cicd/deploy_ephemeral_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ bonfire deploy \
--set-template-ref ${APP_NAME}/${COMPONENT_NAME}=${GIT_COMMIT} \
--set-image-tag ${IMAGE}=${IMAGE_TAG} \
--namespace ${NAMESPACE} \
${COMPONENTS}
${COMPONENTS_ARG}

0 comments on commit 62728fd

Please sign in to comment.