Skip to content

Commit

Permalink
use log level for logging
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Hebert <[email protected]>
  • Loading branch information
scoheb committed Apr 18, 2024
1 parent 1685757 commit a457244
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion task/prefetch-dependencies/0.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See docs at https://github.com/containerbuildsystem/cachi2#basic-usage.
|---|-----------------------------------------------------------------------------------------------------------------------------------------------------|---|---|
|input| Configures project packages that will have their dependencies prefetched. ||true|
|dev-package-managers| Enable in-development package managers. WARNING: the behavior may change at any time without notice. Use at your own risk. |false|false|
|enable-debug-logging| Enable debug logging with cachi2 |false|false|
|log-level| Set cachi2 log level |info|false|

## Workspaces
|name|description|optional|
Expand Down
24 changes: 10 additions & 14 deletions task/prefetch-dependencies/0.1/prefetch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ spec:
name: dev-package-managers
default: "false"
- description: >
Enable cachi2 debug logging
name: enable-debug-logging
default: "false"
Set cachi2 log level
name: log-level
default: "info"
- name: caTrustConfigMapName
type: string
description: The name of the ConfigMap to read CA bundle data from.
Expand All @@ -47,8 +47,8 @@ spec:
value: $(params.input)
- name: DEV_PACKAGE_MANAGERS
value: $(params.dev-package-managers)
- name: ENABLE_DEBUG
value: $(params.enable-debug-logging)
- name: LOG_LEVEL
value: $(params.log-level)
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND
value: $(workspaces.basic-auth.bound)
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH
Expand All @@ -72,12 +72,6 @@ spec:
dev_pacman_flag=""
fi
if [ "$ENABLE_DEBUG" = "true" ]; then
debug_log_flag="--log-level=debug"
else
debug_log_flag=""
fi
if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then
if [ -f "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" ] && [ -f "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" ]; then
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" "${PARAM_USER_HOME}/.git-credentials"
Expand All @@ -104,24 +98,26 @@ spec:
update-ca-trust
fi
log_level_flag="--log-level=${LOG_LEVEL}"
cachi2 \
$debug_log_flag \
$log_level_flag \
fetch-deps \
$dev_pacman_flag \
--source=$(workspaces.source.path)/source \
--output=$(workspaces.source.path)/cachi2/output \
"${INPUT}"
cachi2 \
$debug_log_flag \
$log_level_flag \
generate-env \
$(workspaces.source.path)/cachi2/output \
--format env \
--for-output-dir=/cachi2/output \
--output $(workspaces.source.path)/cachi2/cachi2.env
cachi2 \
$debug_log_flag \
$log_level_flag \
inject-files \
$(workspaces.source.path)/cachi2/output \
--for-output-dir=/cachi2/output
Expand Down

0 comments on commit a457244

Please sign in to comment.