kas-container: add --git-credential-store
options
This options allows to specify a git credential store file, which is then mounted into the container and used by kas as a git-credential-helper. Signed-off-by: Claudius Heine <ch@denx.de> [Jan: remove debug echo] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
71e7f5523d
commit
7c6e3c3994
@ -51,6 +51,8 @@ usage()
|
|||||||
printf "%b" "\t\t\tAvoid \$HOME/.ssh unless you fully trust the " \
|
printf "%b" "\t\t\tAvoid \$HOME/.ssh unless you fully trust the " \
|
||||||
"container.\n"
|
"container.\n"
|
||||||
printf "%b" "--aws-dir\t\tDirectory containing AWScli configuration.\n"
|
printf "%b" "--aws-dir\t\tDirectory containing AWScli configuration.\n"
|
||||||
|
printf "%b" "--git-credential-store\tFile path to the git credential " \
|
||||||
|
"store\n"
|
||||||
printf "%b" "--no-proxy-from-env\tDo not inherit proxy settings from " \
|
printf "%b" "--no-proxy-from-env\tDo not inherit proxy settings from " \
|
||||||
"environment.\n"
|
"environment.\n"
|
||||||
printf "%b" "--repo-ro\t\tMount current repository read-only\n" \
|
printf "%b" "--repo-ro\t\tMount current repository read-only\n" \
|
||||||
@ -167,6 +169,11 @@ while [ $# -gt 0 ]; do
|
|||||||
KAS_AWS_DIR="$2"
|
KAS_AWS_DIR="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
--git-credential-store)
|
||||||
|
[ $# -gt 2 ] || usage
|
||||||
|
KAS_GIT_CREDENTIAL_STORE="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--no-proxy-from-env)
|
--no-proxy-from-env)
|
||||||
KAS_NO_PROXY_FROM_ENV=1
|
KAS_NO_PROXY_FROM_ENV=1
|
||||||
shift 1
|
shift 1
|
||||||
@ -327,6 +334,23 @@ if [ -n "${KAS_AWS_DIR}" ] ; then
|
|||||||
-e AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-/etc/skel/.aws/credentials}"
|
-e AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-/etc/skel/.aws/credentials}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
KAS_GIT_CREDENTIAL_HELPER_DEFAULT=""
|
||||||
|
|
||||||
|
if [ -n "${KAS_GIT_CREDENTIAL_STORE}" ] ; then
|
||||||
|
if [ ! -f "${KAS_GIT_CREDENTIAL_STORE}" ]; then
|
||||||
|
echo "Passed KAS_GIT_CREDENTIAL_STORE '${KAS_AWS_DIR}' is not a file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
KAS_GIT_CREDENTIAL_HELPER_DEFAULT="store --file=/etc/skel/.git-credentials"
|
||||||
|
set -- "$@" -v "$(readlink -f "${KAS_GIT_CREDENTIAL_STORE}")":/etc/skel/.git-credentials:ro
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER:-${KAS_GIT_CREDENTIAL_HELPER_DEFAULT}}"
|
||||||
|
|
||||||
|
if [ -n "${GIT_CREDENTIAL_HELPER}" ] ; then
|
||||||
|
set -- "$@" -e GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
set -- "$@" -t -i
|
set -- "$@" -t -i
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user