mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-25 12:31:34 +01:00
ci-automation: Fix credentials handling in digital ocean
This commit is contained in:
parent
3c119f14b2
commit
3b3cffabc8
@ -94,4 +94,4 @@ GCE_PARALLEL="${PARALLEL_TESTS:-4}"
|
|||||||
: ${DIGITALOCEAN_MACHINE_SIZE:='s-2vcpu-2gb'}
|
: ${DIGITALOCEAN_MACHINE_SIZE:='s-2vcpu-2gb'}
|
||||||
DIGITALOCEAN_PARALLEL="${PARALLEL_TESTS:-8}"
|
DIGITALOCEAN_PARALLEL="${PARALLEL_TESTS:-8}"
|
||||||
# DIGITALOCEAN_TOKEN_JSON env var is used for credentials, and should
|
# DIGITALOCEAN_TOKEN_JSON env var is used for credentials, and should
|
||||||
# come from sdk_container/.env
|
# come from sdk_container/.env. It must be base64-encoded.
|
||||||
|
|||||||
@ -275,8 +275,9 @@ function url_from_template() {
|
|||||||
# --
|
# --
|
||||||
|
|
||||||
# Puts a secret into a file, while trying for the secret to not end up
|
# Puts a secret into a file, while trying for the secret to not end up
|
||||||
# on a filesystem at all. A path to the file with the secret in
|
# on a filesystem at all. A path to the file with the secret in /proc
|
||||||
# /proc in put into the chosen variable.
|
# in put into the chosen variable. The secret is assumed to be
|
||||||
|
# base64-encoded.
|
||||||
#
|
#
|
||||||
# Typical use:
|
# Typical use:
|
||||||
# secret_file=''
|
# secret_file=''
|
||||||
@ -294,7 +295,7 @@ function secret_to_file() {
|
|||||||
|
|
||||||
exec {fd}<>"${tmpfile}"
|
exec {fd}<>"${tmpfile}"
|
||||||
rm -f "${tmpfile}"
|
rm -f "${tmpfile}"
|
||||||
echo "${secret}" >&${fd}
|
echo "${secret}" | base64 --decode >&${fd}
|
||||||
config_ref="/proc/${$}/fd/${fd}"
|
config_ref="/proc/${$}/fd/${fd}"
|
||||||
}
|
}
|
||||||
# --
|
# --
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user