mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Extract endpoint docker inspection to a function
This commit is contained in:
parent
e67a7b4440
commit
2d55a3638f
21
psu
21
psu
@ -825,12 +825,7 @@ deploy() {
|
||||
# Get Docker info
|
||||
echo_verbose "Getting Docker info..."
|
||||
local docker_info
|
||||
docker_info=$(http \
|
||||
--check-status \
|
||||
--ignore-stdin \
|
||||
--verify=$HTTPIE_VERIFY_SSL \
|
||||
"$PORTAINER_URL/api/endpoints/$PORTAINER_ENDPOINT/docker/info" \
|
||||
"Authorization: Bearer $AUTH_TOKEN")
|
||||
docker_info=$(docker_info)
|
||||
check_for_errors $? "$docker_info"
|
||||
echo_debug "Docker info -> $(echo $docker_info | jq -C .)"
|
||||
|
||||
@ -1002,6 +997,20 @@ env_file_to_json() {
|
||||
echo "$(env -i sh -c "(unset \$(env | sed 's/=.*//'); set -a; . $(readlink -f $ENVIRONMENT_VARIABLES_FILE); set +a; jq -njc 'env | to_entries | map({name: .key, value: .value})')")"
|
||||
}
|
||||
|
||||
# Get Docker info
|
||||
docker_info() {
|
||||
local docker_info
|
||||
docker_info=$(http \
|
||||
--check-status \
|
||||
--ignore-stdin \
|
||||
--verify=$HTTPIE_VERIFY_SSL \
|
||||
"$PORTAINER_URL/api/endpoints/$PORTAINER_ENDPOINT/docker/info" \
|
||||
"Authorization: Bearer $AUTH_TOKEN")
|
||||
check_for_errors $? "$docker_info"
|
||||
|
||||
echo "$docker_info"
|
||||
}
|
||||
|
||||
tasks() {
|
||||
local desired_state=$1
|
||||
local state=$2
|
||||
|
Loading…
Reference in New Issue
Block a user