Skip to main content
added 272 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerlanddomain.caname/flyerlandwebsite:rel-1.0.0 --explode OUTPUT_FILE="${USER_PATH}/${RELEASE}.tar.gz"; git archive --verbose --prefix=${PREFIX}/ -o ${OUTPUT_FILE} ${RELEASE} cd "${USER_PATH}"; if [[ "${3}" =~ [--explode] ]]; then if [ -d "./${RELEASE}" ]; then /bin/rm -rf "./${RELEASE}"; fi mkdir -p ./${RELEASE}; tar -xzf "${OUTPUT_FILE}" -C ./${RELEASE} fi ## Purging SRC/TRG_DIRs variable(s): unset PREFIX REPO_PATH RELEASE USER_PATH;USER_PATH OUTPUT_FILE; return 0; } 
function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerland.ca/flyerland:rel-1.0.0 --explode OUTPUT_FILE="${USER_PATH}/${RELEASE}.tar.gz"; git archive --verbose --prefix=${PREFIX}/ -o ${OUTPUT_FILE} ${RELEASE} cd "${USER_PATH}"; if [[ "${3}" =~ [--explode] ]]; then if [ -d "./${RELEASE}" ]; then /bin/rm -rf "./${RELEASE}"; fi mkdir -p ./${RELEASE}; tar -xzf "${OUTPUT_FILE}" -C ./${RELEASE} fi ## Purging SRC/TRG_DIRs variable(s): unset PREFIX REPO_PATH RELEASE USER_PATH; return 0; } 
function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/domain.name/website:rel-1.0.0 --explode OUTPUT_FILE="${USER_PATH}/${RELEASE}.tar.gz"; git archive --verbose --prefix=${PREFIX}/ -o ${OUTPUT_FILE} ${RELEASE} cd "${USER_PATH}"; if [[ "${3}" =~ [--explode] ]]; then if [ -d "./${RELEASE}" ]; then /bin/rm -rf "./${RELEASE}"; fi mkdir -p ./${RELEASE}; tar -xzf "${OUTPUT_FILE}" -C ./${RELEASE} fi ## Purging SRC/TRG_DIRs variable(s): unset PREFIX REPO_PATH RELEASE USER_PATH OUTPUT_FILE; return 0; } 
added 272 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerland.ca/flyerland/:rel-1.0.0 --explode OUTPUT_FILE="${USER_PATH}/${RELEASE}.tar.gz"; git archive --verbose --prefix=${PREFIX}/ -o ${OUTPUT_FILE} ${RELEASE} cd "${USER_PATH}"; if [[ "${3}" =~ [--explode] ]]; then if [ -d "./${RELEASE}.tar.gz" ]; then /bin/rm -rf "./${RELEASE}"; fi cd  mkdir -p ./${RELEASE}; tar -xzf "${USER_PATHOUTPUT_FILE}";" -C ./${RELEASE} fi ## Purging SRC/TRG_DIRs variable(s): unset PREFIX RELEASE;REPO_PATH RELEASE USER_PATH; return 0; } 
function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerland.ca/flyerland/rel-1.0.0 git archive --verbose --prefix=${PREFIX}/ -o ${USER_PATH}/${RELEASE}.tar.gz ${RELEASE} cd "${USER_PATH}"; ## Purging SRC/TRG_DIRs variable(s): unset PREFIX RELEASE; return 0; } 
function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerland.ca/flyerland:rel-1.0.0 --explode OUTPUT_FILE="${USER_PATH}/${RELEASE}.tar.gz"; git archive --verbose --prefix=${PREFIX}/ -o ${OUTPUT_FILE} ${RELEASE} cd "${USER_PATH}"; if [[ "${3}" =~ [--explode] ]]; then if [ -d "./${RELEASE}" ]; then /bin/rm -rf "./${RELEASE}"; fi   mkdir -p ./${RELEASE}; tar -xzf "${OUTPUT_FILE}" -C ./${RELEASE} fi ## Purging SRC/TRG_DIRs variable(s): unset PREFIX REPO_PATH RELEASE USER_PATH; return 0; } 
Usage: git-archive /var/www/htdocs /repos/web.domain/website:rel-1.0.0
Source Link
tocororo
  • 81
  • 2
  • 2

I have now incorporated the 'git archive' functionality into a single process that makes use of 'create_empty' function and other features.

function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerland.ca/flyerland/rel-1.0.0 git archive --verbose --prefix=${PREFIX}/ -o ${USER_PATH}/${RELEASE}.tar.gz ${RELEASE} cd "${USER_PATH}"; ## Purging SRC/TRG_DIRs variable(s): unset PREFIX RELEASE; return 0; } 

I have now incorporated the 'git archive' functionality into a single process that makes use of 'create_empty' function and other features.

function git-archive () { PREFIX="${1}"; ## sudo mkdir -p ${PREFIX} REPO_PATH="`echo "${2}"|awk -F: '{print $1}'`"; RELEASE="`echo "${2}"|awk -F: '{print $2}'`"; USER_PATH="${PWD}"; echo "$PREFIX $REPO_PATH $RELEASE $USER_PATH"; ## Dynamically added '.empty' files to the Git-Structure: cd "${REPO_PATH}"; populate_empty .; echo -en "\n"; # git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 # e.g.: git-archive /var/www/htdocs /repos/flyerland.ca/flyerland/rel-1.0.0 git archive --verbose --prefix=${PREFIX}/ -o ${USER_PATH}/${RELEASE}.tar.gz ${RELEASE} cd "${USER_PATH}"; ## Purging SRC/TRG_DIRs variable(s): unset PREFIX RELEASE; return 0; } 
added 1850 characters in body; Post Made Community Wiki
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
deleted 1 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
added 497 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
added 72 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
added 48 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
added 48 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
added 48 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
added 74 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
deleted 26 characters in body
Source Link
tocororo
  • 81
  • 2
  • 2
Loading
Source Link
tocororo
  • 81
  • 2
  • 2
Loading