forked from WrenSecurity/wrensec-deploy-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preload_creds.sh
42 lines (37 loc) · 1.62 KB
/
preload_creds.sh
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
34
35
36
37
38
39
40
41
42
################################################################################
# Wren Deploy Credential Pre-Loader
# =================================
# Lets the user provide credentials for JFrog / BinTray / GPG up-front, once
# during a bash terminal session, instead of having to enter them in every time
# they are needed for operations.
#
# Usage: source preload_creds.sh
#
# Credentials are exported into environment variables that exist only for the
# remainder of the shell session. The script must be invoked through `source`
# rather than being executed as a standalone script so that the commands it
# executes occur in the user's Bash session, preserving the exported environment
# variables.
#
# @author Kortanul ([email protected])
#
################################################################################
################################################################################
# Includes
################################################################################
SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
source "${SCRIPT_PATH}/includes/all_includes.sh"
################################################################################
# Main Script
################################################################################
parse_provider_arg $@
if [ "${provider}" == "jfrog" ]; then
creds_prompt_for_jfrog_credentials
elif [ "${provider}" == "bintray" ]; then
creds_prompt_for_bintray_credentials
else
echo_error "Unknown provider: ${provider}"
exit -1
fi
creds_prompt_for_gpg_credentials "${WREN_OFFICIAL_SIGN_KEY_ID}"
creds_prompt_for_gpg_credentials "${WREN_THIRD_PARTY_SIGN_KEY_ID}"