You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/03/14 13:36:44 UTC

[GitHub] houshengbo closed pull request #62: Generate release note

houshengbo closed pull request #62: Generate release note
URL: https://github.com/apache/incubator-openwhisk-release/pull/62
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tools/download_source_code.sh b/tools/download_source_code.sh
index 7a403bb..f019e4e 100755
--- a/tools/download_source_code.sh
+++ b/tools/download_source_code.sh
@@ -33,7 +33,7 @@ function git_clone_repo() {
     git clone --depth $clone_depth -b $BRANCH $REPO $OPENWHISK_SOURCE_DIR/$PROJECT_NAME
     cd $OPENWHISK_SOURCE_DIR/$PROJECT_NAME
     git reset --hard $HASH
-    rm -rf .git
+    #rm -rf .git
 }
 
 rm -rf $OPENWHISK_SOURCE_DIR/*
diff --git a/tools/generate_release_notes.sh b/tools/generate_release_notes.sh
new file mode 100755
index 0000000..feaf037
--- /dev/null
+++ b/tools/generate_release_notes.sh
@@ -0,0 +1,56 @@
+#!/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.
+#
+
+echo "Generate release notes and collect change logs of all projects."
+
+WORK_DIR=${1:-"$HOME"}
+
+SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
+source "$SCRIPTDIR/load_config.sh" $1
+PARENTDIR="$(dirname "$SCRIPTDIR")"
+
+FILE="$WORK_DIR/releaseNotes.md"
+TEMPLATE="$SCRIPTDIR/lib/release_template.md"
+
+# Remove file if exists
+if [ -f "$FILE" ] ; then
+  rm $FILE
+fi
+
+# Read the template
+while IFS= read -r aline; do
+  printf "%s\n" "$aline" >> $FILE
+done <$TEMPLATE
+
+# Print change logs
+for repo in $(echo $repos | sed "s/,/ /g")
+do
+    repo_name=$(echo "$repo" | sed -e 's/^"//' -e 's/"$//')
+    echo "Collect logs in the repository $repo_name"
+    cd $OPENWHISK_SOURCE_DIR/$repo_name
+
+    printf "\n%s\n\n" "## $repo_name" >> $FILE
+    git log --pretty=format:"- %s" --date=short | while read line
+    do
+      PRNUMBER=$(echo $line | egrep -o '\(#[[:digit:]]+\)') # format like (#1234)
+      PRN=$(echo $PRNUMBER | egrep -o '[[:digit:]]+') # format like 1234
+      PRLINK="([#$PRN](https://github.com/apache/incubator-$repo_name/pull/$PRN))"
+      line=${line/$PRNUMBER/$PRLINK}
+      printf "%s\n" "$line" >> $FILE
+    done
+done
diff --git a/tools/lib/release_template.md b/tools/lib/release_template.md
new file mode 100644
index 0000000..d0aeeea
--- /dev/null
+++ b/tools/lib/release_template.md
@@ -0,0 +1,23 @@
+<!--
+#
+# 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.
+#
+-->
+
+# OpenWhisk Release Notes
+
+This is OpenWhisk Release.
+
+# Change logs
diff --git a/tools/package_source_code.sh b/tools/package_source_code.sh
index ed74a8c..d04307a 100755
--- a/tools/package_source_code.sh
+++ b/tools/package_source_code.sh
@@ -33,5 +33,7 @@ rsync -rtp --exclude .*\* --exclude bin\* --exclude build\* $OPENWHISK_SOURCE_DI
 for repo in $(echo $repos | sed "s/,/ /g")
 do
     repo_name=$(echo "$repo" | sed -e 's/^"//' -e 's/"$//')
-    cd $OPENWHISK_CLEANED_SOURCE_DIR/$repo_name && tar czf ${CURRENT_VERSION_DIR}/${repo_name}-${version}-sources.tar.gz .
+    cd $OPENWHISK_CLEANED_SOURCE_DIR/$repo_name
+    rm -rf .git
+    tar czf ${CURRENT_VERSION_DIR}/${repo_name}-${version}-sources.tar.gz .
 done


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services