javeme commented on code in PR #122:
URL: 
https://github.com/apache/incubator-hugegraph-commons/pull/122#discussion_r1038968427


##########
apache-release.sh:
##########
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+#
+# 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.
+#
+
+group="hugegraph"
+# current repository name
+repo="${group}-commons"
+# release version (input by committer)
+release_version=$1
+# git release branch (check it carefully)
+git_branch="release-${release_version}"
+
+release_version=${release_version:?"Please input the release version behind 
script"}
+
+work_dir=$(cd "$(dirname "$0")" || exit; pwd)
+cd "${work_dir}" || exit
+echo "In the work dir: $(pwd)"
+
+# clean old dir then build a new one
+rm -rfv dist && mkdir -p dist/apache-${repo}
+
+# step1: package the source code
+git archive --format=tar.gz \
+  
--output="dist/apache-${repo}/apache-${repo}-${release_version}-incubating-src.tar.gz"
 \
+  --prefix=apache-${repo}-"${release_version}"-incubating-src/ "${git_branch}" 
|| exit
+
+# step2: copy the binary file (Optional)
+# Note: it's optional for project to generate binary package (skip this step 
if not need)
+#cp -v 
${group}-dist/target/apache-${repo}-"${release_version}"-incubating-bin.tar.gz \
+#  dist/apache-${repo} || exit
+
+# step3: sign + hash
+##### 3.1 sign in source & binary package
+gpg --version 1>/dev/null || exit
+cd ./dist/apache-${repo} || exit
+for i in *.tar.gz; do
+  echo "$i" && gpg --armor --output "$i".asc --detach-sig "$i"
+done
+
+##### 3.2 Generate SHA512 file
+shasum --version 1>/dev/null || exit
+for i in *.tar.gz; do
+  echo "$i" && shasum -a 512 "$i" >"$i".sha512
+done
+
+#### 3.3 check signature & sha512
+for i in *.tar.gz; do
+  echo "$i"
+  gpg --verify "$i".asc "$i" || exit
+done
+
+for i in *.tar.gz; do
+  echo "$i"
+  shasum -a 512 --check "$i".sha512 || exit
+done
+
+# step4: upload to Apache-SVN
+svn_dir="${group}-svn-dev"

Review Comment:
   keep var names uppercase



##########
hugegraph-dist/scripts/dependency/check_dependencies.sh:
##########
@@ -16,16 +16,16 @@
 # limitations under the License.
 #
 
-BASE_PATH=$(cd $(dirname $0); pwd)
+BASE_PATH=$(cd "$(dirname "$0")" || exit; pwd)
 
 # check whether there are new third-party dependencies by diff command,
 # diff generated 'current-dependencies.txt' file with 'known-dependencies.txt' 
file.
-diff -w -B -U0 <(sort < ${BASE_PATH}/known-dependencies.txt) \
-<(sort < ${BASE_PATH}/current-dependencies.txt) > ${BASE_PATH}/result.txt
+diff -w -B -U0 <(sort <"${BASE_PATH}"/known-dependencies.txt) \
+  <(sort <"${BASE_PATH}"/current-dependencies.txt) >"${BASE_PATH}"/result.txt

Review Comment:
   ditto



##########
hugegraph-dist/scripts/dependency/check_dependencies.sh:
##########
@@ -16,16 +16,16 @@
 # limitations under the License.
 #
 
-BASE_PATH=$(cd $(dirname $0); pwd)
+BASE_PATH=$(cd "$(dirname "$0")" || exit; pwd)
 
 # check whether there are new third-party dependencies by diff command,
 # diff generated 'current-dependencies.txt' file with 'known-dependencies.txt' 
file.
-diff -w -B -U0 <(sort < ${BASE_PATH}/known-dependencies.txt) \
-<(sort < ${BASE_PATH}/current-dependencies.txt) > ${BASE_PATH}/result.txt
+diff -w -B -U0 <(sort <"${BASE_PATH}"/known-dependencies.txt) \

Review Comment:
   keep the space after "<"?



##########
hugegraph-dist/scripts/apache-release.sh:
##########
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+#
+# 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.
+#
+
+group="hugegraph"
+# current repository name
+repo="${group}-commons"
+# release version (input by committer)
+release_version=$1
+# git release branch (check it carefully)
+git_branch="release-${release_version}"

Review Comment:
   keep var names uppercase



##########
hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh:
##########
@@ -16,18 +16,18 @@
 # limitations under the License.
 #
 
-BASE_PATH=$(cd $(dirname $0); pwd)
+BASE_PATH=$(cd "$(dirname "$0")" || exit; pwd)
 DEP_PATH=$BASE_PATH/all_dependencies
 FILE_NAME=${1:-known-dependencies.txt}
 
-if [[ -d $DEP_PATH ]];then
+if [[ -d $DEP_PATH ]]; then
   echo "rm -r -f DEP_PATH"
-  rm -r -f $DEP_PATH
+  rm -r -f "$DEP_PATH"
 fi
 
-cd $BASE_PATH/../../../
+cd "$BASE_PATH"/../../../ || exit
 
-mvn dependency:copy-dependencies -DincludeScope=runtime 
-DoutputDirectory=$DEP_PATH
+mvn dependency:copy-dependencies -DincludeScope=runtime 
-DoutputDirectory="$DEP_PATH"
 
-ls $DEP_PATH | egrep -v "^hugegraph|hubble" | sort -n > $BASE_PATH/$FILE_NAME
-rm -r -f $DEP_PATH
+ls "$DEP_PATH" | egrep -v "^hugegraph|hubble" | sort -n 
>"$BASE_PATH"/"$FILE_NAME"

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to