Procházet zdrojové kódy

use https module for initial clone/build

master
Jonathan Cobb před 3 roky
rodič
revize
1398c20f4b
2 změnil soubory, kde provedl 36 přidání a 2 odebrání
  1. +11
    -2
      bin/jvc_common
  2. +25
    -0
      bin/use_https_submodule

+ 11
- 2
bin/jvc_common Zobrazit soubor

@@ -63,8 +63,17 @@ if [[ -z "${JVC_JAR}" ]] ; then

# Build and install utility library
pushd "${JVC_DIR}"/utils/cobbzilla-utils || die "Error changing directories to ${JVC_DIR}/utils/cobbzilla-utils"
mvn -DskipTests=true clean install || die "Error building cobbzilla-utils library"
popd || die "popd error"
if [[ -z "$(find target -type f -name "*.jar")" ]] ; then
if [[ -z "$(find . -type f)" ]] ; then
cd ../.. && \
./bin/use_https_submodule && \
git submodule update --init --recursive && \
cd - \
|| die "Error updating git submodule"
fi
mvn -DskipTests=true clean install || die "Error building cobbzilla-utils library"
popd || die "popd error"
fi

# Build jvc uberjar
pushd "${JVC_DIR}" || die "Error changing directories to ${JVC_DIR}"


+ 25
- 0
bin/use_https_submodule Zobrazit soubor

@@ -0,0 +1,25 @@
#!/bin/bash
#
# Update .gitmodules file to use HTTPS URLs instead of SSH URLs for git submodules
#
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
GIT_MODS="${SCRIPT_DIR}/../.gitmodules"
GIT_TEMP_FILE="$(mktemp "${GIT_MODS}.XXXXXXX")"
CHANGED_MARKER="${GIT_TEMP_FILE}.use"
cat "${GIT_MODS}" | while read -r line; do
if [[ $(echo "${line}" | grep -c 'url = ') -gt 0 && $(echo "${line}" | grep -c 'git@git') -gt 0 ]]; then
REPO="$(echo "${line}" | awk -F ':' '{print $2}')"
echo "url = https://git.bubblev.org/${REPO}" | tee -a "${GIT_TEMP_FILE}"
touch "${CHANGED_MARKER}"
else
echo "${line}" | tee -a "${GIT_TEMP_FILE}"
fi
done

if [[ -f "${CHANGED_MARKER}" ]]; then
cd "${SCRIPT_DIR}/.." && \
git update-index --assume-unchanged "$(basename "${GIT_MODS}")" && \
mv "${GIT_TEMP_FILE}" "${GIT_MODS}" || \
echo "$0: error updating file: ${GIT_MODS}"
fi
rm -f "${CHANGED_MARKER}"

Načítá se…
Zrušit
Uložit