From a982b14c4424852ad524cb89440dd23252803c8e Mon Sep 17 00:00:00 2001 From: Karuhatty Date: Fri, 23 Feb 2018 14:27:58 -0800 Subject: [PATCH 1/5] temporary fix to update the verionsioning of 1.1.0 that is skipped during build process --- docs/build_version_doc/build_doc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build_version_doc/build_doc.sh b/docs/build_version_doc/build_doc.sh index eefc81e362e8..20563344ed48 100755 --- a/docs/build_version_doc/build_doc.sh +++ b/docs/build_version_doc/build_doc.sh @@ -49,12 +49,12 @@ then fi # Build new released tag -if [ $latest_tag != ${tag_list[0]} ] +if [ $latest_tag == ${tag_list[0]} ] # this is a temporary fix changed from != to == (SHOULD BE REMOVED LATER) then echo "Building new tag" git submodule update make docs || exit 1 - echo -e "$latest_tag\n$(cat $tag_list_file)" > "$tag_list_file" + #echo -e "$latest_tag\n$(cat $tag_list_file)" > "$tag_list_file" cat $tag_list_file tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "docs/_build/html/" --current_version "$latest_tag" tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddPackageLink.py \ @@ -83,7 +83,7 @@ cp -a "docs/_build/html/." "$web_folder/versions/master" tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "$web_folder/versions/master" # Update version list for all previous version website -if [ $latest_tag != ${tag_list[0]} ] +if [ $latest_tag == ${tag_list[0]} ] # this is a temporary fix changed from != to == (SHOULD BE REMOVED LATER) then total=${#tag_list[*]} for (( i=0; i<=$(( $total -1 )); i++ )) From 9a22e06455b0cda583ba4966954ff8d7a75f0e10 Mon Sep 17 00:00:00 2001 From: Karuhatty Date: Mon, 26 Feb 2018 16:46:22 -0800 Subject: [PATCH 2/5] updated build_doc.sh --- docs/build_version_doc/build_doc.sh | 58 ++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/docs/build_version_doc/build_doc.sh b/docs/build_version_doc/build_doc.sh index 20563344ed48..ca742d5ad60e 100755 --- a/docs/build_version_doc/build_doc.sh +++ b/docs/build_version_doc/build_doc.sh @@ -19,10 +19,22 @@ set -e set -x +# This script is run on a nightly basis. Refer to Job: http://jenkins.mxnet-ci.amazon-ml.com/job/incubator-mxnet-build-site/ +# Job should pass in paramters: +# web_url=https://github.com/apache/incubator-mxnet-site +# web_branch=asf-site +# release_branch=v1.1.0 (example). This needs to come from the job config + +# First parameter sent by job configuration: https://github.com/apache/incubator-mxnet-site web_url="$1" + +# Second parameter sent by job configuration: asf-site +web_branch="$2" + web_folder="VersionedWeb" + local_build="latest" -web_branch="$2" + git clone $web_url $web_folder cd $web_folder git checkout $web_branch @@ -37,25 +49,39 @@ while read -r line do tag_list+=("$line") done < "$tag_list_file" + +# This is the first tag found in tag.txt latest_tag=${tag_list[0]} -echo "latest_tag is: $latest_tag" +echo "LATEST TAG found in tag.txt file is : $latest_tag" + commit_id=$(git rev-parse HEAD) + +# Find the current TAG in GIT curr_tag=${TAG} curr_tag=${curr_tag:5} -echo "Current tag is $curr_tag" + +echo "CURRENT TAG IN GIT is $curr_tag" + +# If current tag in git is newer than latest tag found in tag.txt if [[ "$curr_tag" != 'master' ]] && [ $curr_tag != $latest_tag ] then + echo "++++ Found a git TAG $curr_tag newer than mxnet repo tag $latest_tag , we need to build a new release ++++" + echo "assigning curr_tag to latest_tag" latest_tag=$curr_tag fi # Build new released tag -if [ $latest_tag == ${tag_list[0]} ] # this is a temporary fix changed from != to == (SHOULD BE REMOVED LATER) +if [ $latest_tag != ${tag_list[0]} ] then - echo "Building new tag" + echo "++++ Building new tag $latest_tag ++++" git submodule update + + # checkout the latest release tag. + echo "++++ Checking out tag $latest_tag ++++" + git checkout tags/$latest_tag + make docs || exit 1 - #echo -e "$latest_tag\n$(cat $tag_list_file)" > "$tag_list_file" - cat $tag_list_file + tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "docs/_build/html/" --current_version "$latest_tag" tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddPackageLink.py \ --file_path "docs/_build/html/install/index.html" --current_version "$latest_tag" @@ -69,13 +95,27 @@ then rm -rf "$local_build/versions/${tag_list[0]}/versions" rm -rf "$web_folder/*" cp -a "$local_build/." "$web_folder" + + # Update the tag_list now we have updated the local build with latest release. + ###### content of tag.txt######## + # + # 1.0.0 + # 0.12.1 + # 0.12.0 + # 0.11.0 + echo -e "$latest_tag\n$(cat $tag_list_file)" > "$tag_list_file" + cat $tag_list_file + echo " ****************************************** " + echo " Successfully built new release $latest_tag " + echo " ****************************************** " fi # Build latest master +echo " ********** Building Master ************ " git checkout master git checkout -- . git submodule update -echo "Building master" + make docs || exit 1 rm -rfv $web_folder/versions/master/* @@ -83,7 +123,7 @@ cp -a "docs/_build/html/." "$web_folder/versions/master" tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "$web_folder/versions/master" # Update version list for all previous version website -if [ $latest_tag == ${tag_list[0]} ] # this is a temporary fix changed from != to == (SHOULD BE REMOVED LATER) +if [ $latest_tag != ${tag_list[0]} ] # this is a temporary fix changed from != to == (SHOULD BE REMOVED LATER) then total=${#tag_list[*]} for (( i=0; i<=$(( $total -1 )); i++ )) From a0cac24c52ace0a712cd9da8d0429919af1ea5fd Mon Sep 17 00:00:00 2001 From: Karuhatty Date: Mon, 26 Feb 2018 17:17:01 -0800 Subject: [PATCH 3/5] testing new updates of build_doc.sh --- docs/build_version_doc/build_doc.sh | 42 +++++++++++++++++++---------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/docs/build_version_doc/build_doc.sh b/docs/build_version_doc/build_doc.sh index ca742d5ad60e..5cf25f68d544 100755 --- a/docs/build_version_doc/build_doc.sh +++ b/docs/build_version_doc/build_doc.sh @@ -52,7 +52,7 @@ done < "$tag_list_file" # This is the first tag found in tag.txt latest_tag=${tag_list[0]} -echo "LATEST TAG found in tag.txt file is : $latest_tag" +echo "++++ LATEST TAG found in tag.txt file is : $latest_tag ++++" commit_id=$(git rev-parse HEAD) @@ -60,7 +60,10 @@ commit_id=$(git rev-parse HEAD) curr_tag=${TAG} curr_tag=${curr_tag:5} -echo "CURRENT TAG IN GIT is $curr_tag" +## FAKE DATA REMOVE IT !! +curr_tag = 1.1.0 + +echo "++++ CURRENT TAG IN GIT is $curr_tag ++++" # If current tag in git is newer than latest tag found in tag.txt if [[ "$curr_tag" != 'master' ]] && [ $curr_tag != $latest_tag ] @@ -77,14 +80,34 @@ then git submodule update # checkout the latest release tag. - echo "++++ Checking out tag $latest_tag ++++" + echo "++++ Checking out and building new tag $latest_tag ++++" git checkout tags/$latest_tag - make docs || exit 1 tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "docs/_build/html/" --current_version "$latest_tag" tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddPackageLink.py \ --file_path "docs/_build/html/install/index.html" --current_version "$latest_tag" + + # Update the tag_list (tag.txt). + ###### content of tag.txt######## + # + # 1.0.0 + # 0.12.1 + # 0.12.0 + # 0.11.0 + echo "++++ Adding $latest_tag to the top of the $tag_list_file ++++" + echo -e "$latest_tag\n$(cat $tag_list_file)" > "$tag_list_file" + cat $tag_list_file + + # The following block does the following: + # a. copies the static html that was built from new tag to a local sandbox folder. + # b. copies the $tag_list_file into local sandbox tag.txt + # c. removes .git in VersionedWeb folder + # d. copies VersionedWeb/versions to local sandbox versions folder. + # e. makes a new directory with the previous TAG version. N-1 version name (example current: 1.1.0, Previous: 1.0.0) + # f. Copies ReadMe.md to the local sandbox build. + # g. removes the content of VersionedWeb completely. + # f. Adds new content from local sandbox build to VersionedWeb. cp -a "docs/_build/html/." "$local_build" cp $tag_list_file "$local_build/tag.txt" rm -rf "$web_folder/.git" @@ -95,16 +118,7 @@ then rm -rf "$local_build/versions/${tag_list[0]}/versions" rm -rf "$web_folder/*" cp -a "$local_build/." "$web_folder" - - # Update the tag_list now we have updated the local build with latest release. - ###### content of tag.txt######## - # - # 1.0.0 - # 0.12.1 - # 0.12.0 - # 0.11.0 - echo -e "$latest_tag\n$(cat $tag_list_file)" > "$tag_list_file" - cat $tag_list_file + echo " ****************************************** " echo " Successfully built new release $latest_tag " echo " ****************************************** " From 26d9d471da033eb21d5be81e8bb1d06309816bc2 Mon Sep 17 00:00:00 2001 From: Karuhatty Date: Mon, 26 Feb 2018 17:22:32 -0800 Subject: [PATCH 4/5] fixed comments and syntax --- docs/build_version_doc/build_doc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/build_version_doc/build_doc.sh b/docs/build_version_doc/build_doc.sh index 5cf25f68d544..bcd7897da285 100755 --- a/docs/build_version_doc/build_doc.sh +++ b/docs/build_version_doc/build_doc.sh @@ -61,7 +61,7 @@ curr_tag=${TAG} curr_tag=${curr_tag:5} ## FAKE DATA REMOVE IT !! -curr_tag = 1.1.0 +curr_tag=1.1.0 echo "++++ CURRENT TAG IN GIT is $curr_tag ++++" @@ -76,7 +76,9 @@ fi # Build new released tag if [ $latest_tag != ${tag_list[0]} ] then - echo "++++ Building new tag $latest_tag ++++" + echo " ****************************************** " + echo " Building new release on: $latest_tag " + echo " ****************************************** " git submodule update # checkout the latest release tag. From 61ddcad86fca6745a587d5ec1748671b205b1d02 Mon Sep 17 00:00:00 2001 From: Karuhatty Date: Mon, 26 Feb 2018 23:18:56 -0800 Subject: [PATCH 5/5] removed test data and comments --- docs/build_version_doc/build_doc.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/build_version_doc/build_doc.sh b/docs/build_version_doc/build_doc.sh index bcd7897da285..2e4ed063d5ed 100755 --- a/docs/build_version_doc/build_doc.sh +++ b/docs/build_version_doc/build_doc.sh @@ -60,9 +60,6 @@ commit_id=$(git rev-parse HEAD) curr_tag=${TAG} curr_tag=${curr_tag:5} -## FAKE DATA REMOVE IT !! -curr_tag=1.1.0 - echo "++++ CURRENT TAG IN GIT is $curr_tag ++++" # If current tag in git is newer than latest tag found in tag.txt @@ -139,7 +136,7 @@ cp -a "docs/_build/html/." "$web_folder/versions/master" tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "$web_folder/versions/master" # Update version list for all previous version website -if [ $latest_tag != ${tag_list[0]} ] # this is a temporary fix changed from != to == (SHOULD BE REMOVED LATER) +if [ $latest_tag != ${tag_list[0]} ] then total=${#tag_list[*]} for (( i=0; i<=$(( $total -1 )); i++ ))