-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
34 lines (25 loc) · 817 Bytes
/
entrypoint.sh
File metadata and controls
34 lines (25 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
set -eu
# Read settings.api_key from .drone.yml file
export FOSSA_API_KEY="${PLUGIN_API_KEY}"
# Read settings.command from .drone.yml file
settings_command="${PLUGIN_COMMAND:-}"
# Read settings.debug from .drone.yml file
settings_debug="${PLUGIN_DEBUG:-}"
# Check for fossa-cli command
if [ -z "${settings_command}" ]; then
# Execute analyze by default
fossa_cli_command="${1:-analyze}"
if [ "${settings_debug}" = "true" ]; then
echo "entrypoint script argument command is ${fossa_cli_command}"
fi
else
fossa_cli_command="${settings_command}"
if [ "${settings_debug}" = "true" ]; then
echo "environment variable command is ${fossa_cli_command}"
fi
fi
if [ "${settings_debug}" = "true" ]; then
echo "fossa-cli command is ${fossa_cli_command}"
fi
fossa "${fossa_cli_command}"