1
0
Fork 0

Inline config, remove VERSIONS / SUMMARY.md files

This commit is contained in:
Simran Brucherseifer 2019-10-16 14:10:12 +02:00
parent 8d5ce22118
commit f2f97c716b
7 changed files with 62 additions and 70 deletions

View File

@ -1,6 +0,0 @@
<!-- SYNC: https://@github.com/arangodb/arangodb-java-driver.git;arangodb-java-driver;docs/Drivers;;/ -->
<!-- SYNC: https://@github.com/arangodb/arangodb-php.git;arangodb-php;docs/Drivers;;/ -->
<!-- SYNC: https://@github.com/arangodb/arangodb-spark-connector.git;arangodb-spark-connector;docs/Drivers;;/ -->
<!-- SYNC: https://@github.com/arangodb/arangojs.git;arangojs;docs/Drivers;;/ -->
<!-- SYNC: https://@github.com/arangodb/go-driver.git;go-driver;docs/Drivers;;/ -->
<!-- SYNC: https://@github.com/arangodb/spring-data.git;spring-data;docs/Drivers;;/ -->

View File

@ -1,3 +0,0 @@
<!-- SYNC: https://@github.com/arangodb-helper/arangodb.git;arangodb;docs/Manual;;/ -->
<!-- SYNC: https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ -->
<!-- SYNC: https://@github.com/arangodb/kube-arangodb.git;kube-arangodb;docs/Manual;;/ -->

View File

@ -2,66 +2,77 @@
set -e
ALLBOOKS="HTTP AQL Manual Cookbook Drivers"
SOURCES=(
"https://@github.com/arangodb-helper/arangodb.git;arangodb-starter;master;docs/;Manual/"
"https://@github.com/arangodb/arangosync.git;arangosync;master;docs/;Manual/"
"https://@github.com/arangodb/kube-arangodb.git;kube-arangodb;master;docs/;Manual/"
"https://@github.com/arangodb/arangodb-java-driver.git;arangodb-java-driver;master;docs/;Drivers/"
"https://@github.com/arangodb/arangodb-php.git;arangodb-php;devel;docs/;Drivers/"
"https://@github.com/arangodb/arangodb-spark-connector.git;arangodb-spark-connector;master;docs/;Drivers/"
"https://@github.com/arangodb/arangojs.git;arangojs;master;docs/;Drivers/"
"https://@github.com/arangodb/go-driver.git;go-driver;master;docs/;Drivers/"
"https://@github.com/arangodb/spring-data.git;spring-data;master;docs/;Drivers/"
)
GITAUTH="$1"
for book in ${ALLBOOKS}; do
if test "${GITAUTH}" == "git"; then
ssh-add -l &>/dev/null
if [ "$?" == 2 ]; then
# Could not open a connection to your authentication agent.
eval `ssh-agent`
ssh-add -l &>/dev/null
if [ "$?" == 1 ]; then
# The agent has no identities.
ssh-add
fi
fi
fi
repos=$(grep '^ *<!-- SYNC: ' "../Books/${book}/SUMMARY.md" |sed -r 's;^ *<!-- SYNC: (.+) -->$;\1;')
for source in ${SOURCES[@]}; do
for oneRepo in ${repos}; do
REPO=$(echo "$source" |cut -d ';' -f 1)
CLONEDIR=$(echo "$source" |cut -d ';' -f 2)
BRANCH=$(echo "$source" |cut -d ';' -f 3)
SUBDIR=$(echo "$source" |cut -d ';' -f 4)
DST=$(echo "$source" |cut -d ';' -f 5)
REPO=$(echo "$oneRepo" |cut -d ';' -f 1)
CLONEDIR=$(echo "$oneRepo" |cut -d ';' -f 2)
SUBDIR=$(echo "$oneRepo" |cut -d ';' -f 3)
SRC=$(echo "$oneRepo" |cut -d ';' -f 4)
DST=$(echo "$oneRepo" |cut -d ';' -f 5)
CODIR="../Books/repos/${CLONEDIR}"
AUTHREPO="${REPO/@/${GITAUTH}@}"
if test -d "${CODIR}"; then
(
cd "${CODIR}"
git pull --all
)
else
if test "${GITAUTH}" == "git"; then
AUTHREPO=$(echo "${AUTHREPO}" | sed -e "s;github.com/;github.com:;" -e "s;https://;;" )
fi
git clone "${AUTHREPO}" "${CODIR}"
fi
if [ -z "${BRANCH}" ]; then
echo "No branch specified for ${CLONEDIR}"
exit 1
fi
CODIR="../Books/repos/${CLONEDIR}"
AUTHREPO="${REPO/@/${GITAUTH}@}"
if test -d "${CODIR}"; then
(
cd "${CODIR}"
git pull --all
)
# checkout branch and pull=merge origin
(cd "${CODIR}" && git checkout "${BRANCH}" && git pull)
for oneMD in $(cd "${CODIR}/${SUBDIR}/${DST}"; find "./" -type f |sed "s;\./;;"); do
NAME=$(basename "${oneMD}")
MDSUBDIR="${oneMD/${NAME}/}"
DSTDIR="../Books/${DST}/${MDSUBDIR}"
TOPREF=$(echo "${MDSUBDIR}" | sed 's;\([a-zA-Z]*\)/;../;g')
if test ! -d "${DSTDIR}"; then
mkdir -p "${DSTDIR}"
fi
sourcefile="${CODIR}/${SUBDIR}/${DST}/${oneMD}"
targetfile="${DSTDIR}/${NAME}"
if [[ "$sourcefile" == *.md ]]; then
sed "s;https://docs.arangodb.com/latest;../${TOPREF};g" "$sourcefile" > "$targetfile"
else
if test "${GITAUTH}" == "git"; then
AUTHREPO=$(echo "${AUTHREPO}" | sed -e "s;github.com/;github.com:;" -e "s;https://;;" )
fi
git clone "${AUTHREPO}" "${CODIR}"
cp "$sourcefile" "$targetfile"
fi
# extract branch/tag/... for checkout from VERSIONS file
branch=$(grep "EXTERNAL_DOC_${CLONEDIR}=" "../../VERSIONS" | sed "s/^EXTERNAL_DOC_${CLONEDIR}=//")
if [ -z "${branch}" ]; then
echo "no branch for ${CLONEDIR}, specify in VERSIONS file."
exit 1
fi
# checkout name from VERSIONS file and pull=merge origin
(cd "${CODIR}" && git checkout "${branch}" && git pull)
for oneMD in $(cd "${CODIR}/${SUBDIR}"; find "./${SRC}" -type f |sed "s;\./;;"); do
NAME=$(basename "${oneMD}")
MDSUBDIR="${oneMD/${NAME}/}"
DSTDIR="../Books/${book}/${DST}/${MDSUBDIR}"
TOPREF=$(echo "${MDSUBDIR}" | sed 's;\([a-zA-Z]*\)/;../;g')
if test ! -d "${DSTDIR}"; then
mkdir -p "${DSTDIR}"
fi
sourcefile="${CODIR}/${SUBDIR}/${SRC}/${oneMD}"
targetfile="${DSTDIR}/${NAME}"
if [[ "$sourcefile" == *.md ]]; then
(
echo "<!-- don't edit here, it's from ${REPO} / ${SUBDIR}/${SRC} -->"
sed "s;https://docs.arangodb.com/latest;../${TOPREF};g" "$sourcefile"
) > "$targetfile"
else
cp "$sourcefile" "$targetfile"
fi
done
done
done

View File

@ -1,13 +1,3 @@
STARTER_REV "0.14.5"
SYNCER_REV "0.6.4"
GCC_LINUX "8.3.0"
EXTERNAL_DOC_arangodb-java-driver=master
EXTERNAL_DOC_arangojs=master
EXTERNAL_DOC_arangosync=master
EXTERNAL_DOC_arangodb=master
EXTERNAL_DOC_spring-data=master
EXTERNAL_DOC_kube-arangodb=master
EXTERNAL_DOC_foxx-cli=master
EXTERNAL_DOC_arangodb-php=devel
EXTERNAL_DOC_go-driver=master
EXTERNAL_DOC_arangodb-spark-connector=master