Last active
October 20, 2023 07:38
-
-
Save Gems/a40d7eb45f46c82f990aa7e8845d7e7a to your computer and use it in GitHub Desktop.
Revisions
-
Gems revised this gist
Jul 7, 2022 . 1 changed file with 9 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,22 +18,16 @@ compose-config() { args=() files=() while [ -n "$1" ]; do case "$1" in -f) shift; files+=($1) ;; *) args+=($1) ;; esac shift done echo 'version: "3"' >${TMP_FILE} -
Gems revised this gist
Jul 6, 2022 . 1 changed file with 46 additions and 43 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,43 +1,46 @@ #!/usr/bin/env bash TMP_FILE=/tmp/docker-compose.$$.yaml finish() { rm ${TMP_FILE} ${TMP_FILE}.tmp 2>/dev/null } trap finish EXIT compose-config() { mv -f ${TMP_FILE} ${TMP_FILE}.tmp docker-compose -f ${1} -f ${TMP_FILE}.tmp config >${TMP_FILE} rm -f ${TMP_FILE}.tmp 2>/dev/null } args=() files=() while :; do getopts ":" opt case $OPTARG in f) files+=(${!OPTIND}) ;; \?) args+=("-${OPTARG}" "${!OPTIND}") ;; *) args+=("${!OPTIND}") ;; esac ((OPTIND++)) [ $OPTIND -gt $# ] && break done echo 'version: "3"' >${TMP_FILE} for f in ${files[@]}; do compose-config ${f} done docker-compose -f ${TMP_FILE} ${args[@]} exit $? -
Gems revised this gist
May 2, 2019 . No changes.There are no files selected for viewing
-
Gems created this gist
May 2, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ #!/usr/bin/env bash TMP_FILE=/tmp/docker-compose.$$.yaml finish() { rm ${TMP_FILE} ${TMP_FILE}.tmp 2>/dev/null } trap finish EXIT compose-config() { mv -f ${TMP_FILE} ${TMP_FILE}.tmp docker-compose -f ${1} -f ${TMP_FILE}.tmp config > ${TMP_FILE} rm -f ${TMP_FILE}.tmp 2>/dev/null } args=() files=() while :; do getopts ":" opt case $OPTARG in f) files+=(${!OPTIND}) ;; ?) args+=("-${OPTARG}" "${!OPTIND}") ;; *) args+=("${!OPTIND}") ;; esac ((OPTIND++)) [ $OPTIND -gt $# ] && break done echo 'version: "3"' > ${TMP_FILE} for f in ${files[@]}; do compose-config ${f} done docker-compose -f ${TMP_FILE} ${args[@]} exit $?