tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [1/5] tinkerpop git commit: Upload only diffs in `publish-docs.sh`.
Date Tue, 27 Sep 2016 17:50:14 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/master 6faf9e218 -> dc60e0754


Upload only diffs in `publish-docs.sh`.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/86007ee2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/86007ee2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/86007ee2

Branch: refs/heads/master
Commit: 86007ee2029feeaf592b62978e1b3b0f9cfe2ed0
Parents: 4ed0095
Author: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Authored: Mon Sep 19 15:20:50 2016 +0200
Committer: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Committed: Tue Sep 20 14:40:24 2016 +0200

----------------------------------------------------------------------
 bin/publish-docs.awk | 31 +++++++++++++++++++++++++++++++
 bin/publish-docs.sh  | 42 +++++++++++++++++++++++++-----------------
 2 files changed, 56 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/86007ee2/bin/publish-docs.awk
----------------------------------------------------------------------
diff --git a/bin/publish-docs.awk b/bin/publish-docs.awk
new file mode 100644
index 0000000..d3e0d64
--- /dev/null
+++ b/bin/publish-docs.awk
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#
+# @author Daniel Kuppitz (http://gremlin.guru)
+#
+/^Files / {
+  print "U " gensub("^[^/]*/[^/]*/", "", "g", $2)
+}
+
+/^Only in (java)?docs/ {
+  print "D " gensub(/:$/, "", "g", gensub("^[^/]*/[^/]*/", "", "g", $3)) "/" $4
+}
+
+/^Only in \.\./ {
+  print "A " gensub(/:$/, "", "g", gensub("^[^/]*/[^/]*/[^/]*/", "", "g", $3)) "/" $4
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/86007ee2/bin/publish-docs.sh
----------------------------------------------------------------------
diff --git a/bin/publish-docs.sh b/bin/publish-docs.sh
index 23e2d4d..49ed9bd 100755
--- a/bin/publish-docs.sh
+++ b/bin/publish-docs.sh
@@ -39,25 +39,33 @@ mkdir -p target/svn
 ${SVN_CMD} co --depth immediates https://svn.apache.org/repos/asf/tinkerpop/site target/svn
 
 pushd target/svn
-${SVN_CMD} update --depth empty "docs/${VERSION}"
-${SVN_CMD} update --depth empty "javadocs/${VERSION}"
-${SVN_CMD} rm "docs/${VERSION}"
-${SVN_CMD} rm "javadocs/${VERSION}"
-${SVN_CMD} commit . -m "Docs for TinkerPop ${VERSION} are being replaced."
-popd
 
-mkdir -p "target/svn/docs/${VERSION}"
-mkdir -p "target/svn/javadocs/${VERSION}/core"
-mkdir -p "target/svn/javadocs/${VERSION}/full"
+${SVN_CMD} update "docs/${VERSION}"
+${SVN_CMD} update "javadocs/${VERSION}"
 
-cp -R target/docs/htmlsingle/.   "target/svn/docs/${VERSION}"
-cp -R target/site/apidocs/core/. "target/svn/javadocs/${VERSION}/core"
-cp -R target/site/apidocs/full/. "target/svn/javadocs/${VERSION}/full"
+mkdir -p "docs/${VERSION}"
+mkdir -p "javadocs/${VERSION}/core"
+mkdir -p "javadocs/${VERSION}/full"
 
-pushd target/svn
-rm "docs/${VERSION}/images/tinkerpop3.graffle"
-${SVN_CMD} update --depth empty "docs/${VERSION}"
-${SVN_CMD} update --depth empty "javadocs/${VERSION}"
+diff -rq -I '^Last updated' docs/${VERSION}/ ../docs/htmlsingle/ | awk -f ../../bin/publish-docs.awk
| sed 's/^\(.\) \//\1 /g' > ../publish-docs.docs
+diff -rq -I 'Generated by javadoc' -I '^<meta name="date"' javadocs/${VERSION}/ ../site/apidocs/
| awk -f ../../bin/publish-docs.awk | sed 's/^\(.\) \//\1 /g' > ../publish-docs.javadocs
+
+# copy new / modified files
+for file in $(cat ../publish-docs.docs | awk '/^[AU]/ {print $2}' | grep -v '.graffle$')
+do
+  cp "../docs/htmlsingle/${file}" "docs/${VERSION}/${file}"
+done
+for file in $(cat ../publish-docs.javadocs | awk '/^[AU]/ {print $2}')
+do
+  cp "../site/apidocs/${file}" "javadocs/${VERSION}/${file}"
+done
+
+pushd "docs/${VERSION}/"; cat ../../../publish-docs.docs | awk '/^A/ {print $2}' | grep -v
'.graffle$' | xargs --no-run-if-empty svn add; popd
+pushd "javadocs/${VERSION}/"; cat ../../../publish-docs.javadocs | awk '/^A/ {print $2}'
| xargs --no-run-if-empty svn add; popd
+
+# delete old files
+pushd "docs/${VERSION}/"; cat ../../../publish-docs.docs | awk '/^D/ {print $2}' | xargs
--no-run-if-empty svn delete; popd
+pushd "javadocs/${VERSION}/"; cat ../../../publish-docs.javadocs | awk '/^D/ {print $2}'
| xargs --no-run-if-empty svn delete; popd
 
 for dir in "docs" "javadocs"
 do
@@ -69,8 +77,8 @@ do
   ${SVN_CMD} update --depth empty "${dir}/${CURRENT}"
   ln -s "${CURRENT}" "${dir}/current"
   ${SVN_CMD} update --depth empty "${dir}/current"
+  ${SVN_CMD} add "${dir}/current"
 done
 
-${SVN_CMD} add * --force
 ${SVN_CMD} commit -m "Deploy docs for TinkerPop ${VERSION}"
 popd


Mime
View raw message