Skip to content
Permalink
Browse files
updaate scripts
  • Loading branch information
leerho committed Jul 19, 2019
1 parent 05c7765 commit b0ca4bbf963c27df6e35ff8a48ee2d1b408516bb
Showing 2 changed files with 78 additions and 70 deletions.
@@ -0,0 +1,35 @@
===========The Dist Deployment Structure==========="
The DataSketche base directories in https://dist.apache.org/repos/dist/ are:"
- dev/incubator/datasketches/"
- release/incubator/datasketches/"

Each of these two directories contain a KEYS file, which is where you must have your GPG public key stored."

After graduation the base directories will be the same but without the incubator level."

For both the dev and the release branches, the root contains sub-directories for each of "
the datasketches-X repositories as follows:"
- characterization/"
- core/"
- cpp/"
- hive/"
- memory/"
- pig/"
- postgresql/"
- vector/"

Below these sub=directories is a level of leaf directories that define a particular release or release candidate."

Finally the leaf directories contain the zip and signature files for a release or release candidate."
The full tree will look something like this example:"
dist/"
dev/"
incubator/"
datasketches/"
KEYS"
memory/"
0.12.3-incubating-RC1/"
apache-datasketches-memory-0.12.3-incubating-src.zip"
apache-datasketches-memory-0.12.3-incubating-src.zip.asc"
apache-datasketches-memory-0.12.3-incubating-src.zip.sha512"
etc."
@@ -17,52 +17,16 @@
# specific language governing permissions and limitations
# under the License.

# This assumes it is being executed from the project root directory.
# From the project directory run: scripts/assembleSignVerify.sh
# This script assumes it is being run from the project root directory.
# From the project directory run: scripts/<this script>.sh
# This is generic in that it does not assume a POM file and does not use Maven.
# It does us Git.

# Input Parameters:
# \$1 = project.artifactId
# \$2 = GitHub Tag
# For example: $ scripts/<this script>.sh datasketches-memory 0.12.3-incubator

echo
echo "================Bash Deploy to Dist================"
echo " This script must be run from the base directory of the project."
echo " This script obtains the 'project.artifactId' and the 'project.version' from the \$1 and \$2 input parameters "
echo " For example: $ scripts/bashDeployToDist.sh datasketches-memory 0.12.3-incubator"
echo
echo "===========The Dist Deployment Structure==========="
echo "The DataSketche base directories in https://dist.apache.org/repos/dist/ are:"
echo " - dev/incubator/datasketches/"
echo " - release/incubator/datasketches/"
echo
echo " Each of these two directories contain a KEYS file, which is where you must have your GPG public key stored."
echo
echo "After graduation the base directories will be the same but without the incubator level."
echo
echo "For both the dev and the release branches, the root contains sub-directories for each of "
echo "the datasketches-X repositories as follows:"
echo " - characterization/"
echo " - core/"
echo " - cpp/"
echo " - hive/"
echo " - memory/"
echo " - pig/"
echo " - postgresql/"
echo " - vector/"
echo
echo "Below these sub=directories is a level of leaf directories that define a particular release or release candidate."
echo
echo "Finally the leaf directories contain the zip and signature files for a release or release candidate."
echo "The full tree will look something like this example:"
echo " dist/"
echo " dev/"
echo " incubator/"
echo " datasketches/"
echo " KEYS"
echo " memory/"
echo " 0.12.3-incubating-RC1/"
echo " apache-datasketches-memory-0.12.3-incubating-src.zip"
echo " apache-datasketches-memory-0.12.3-incubating-src.zip.asc"
echo " apache-datasketches-memory-0.12.3-incubating-src.zip.sha512"
echo " etc."
echo
echo "===================Check List======================"
echo "1. Verify that you can successfully read and write to the dist directories using SVN."
@@ -71,20 +35,26 @@ echo "2. Verify that your GPG keys have been created and stored in:"
echo " - https://dist.apache.org/repos/dist/dev/incubator/datasketches/KEYS AND"
echo " - https://dist.apache.org/repos/dist/release/incubator/datasketches/KEYS"
echo
echo "3. Verify the POM project.version format is one of:"
echo " X.Y.Z"
echo " X.Y.Z-SNAPSHOT"
echo " X.Y.Z-incubator"
echo " X.Y.Z-incubator-SNAPSHOT"
echo "3. Run all Unit Tests, Strict Profiles, CheckStyle, SpotBugs, Clover, etc."
echo
echo "4. Locally create a release branch with a name of one of the following forms:"
echo " 1.0.X"
echo " 1.0.X-incubating"
echo
echo "5. Locally create a tag with a name of one of the following forms:"
echo " 1.0.0"
echo " 1.0.0-SNAPSHOT"
echo " 1.0.0-incubator"
echo " 1.0.0-incubator-SNAPSHOT"
echo
echo " 'SNAPSHOT', if relevant, is always at the end of the version string and capitalized."
echo " Note: SNAPSHOT deployments are never relevant for the 'release' branch."
echo " Note: SNAPSHOT deployments are never relevant for the 'dist/release' branch."
echo
echo "4. Verify that your local GitHub repository current and the git status is clean."
echo " Commit the branch and tag back to the remote origin"
echo
echo "5. Locally checkout the branch or tag that you want to deploy."
echo "6. Verify that your local GitHub repository current and the git status is clean."
echo
echo "Proceed? [y|N]"; read confirm; if [[ $confirm != "y" ]]; then echo "Please rerun this script when ready."; exit; fi
echo "Proceed? [y|N]"; read confirm; if [[ $confirm != "y" ]]; then echo "Please rerun this script when ready."; exit 1; fi

TMP=$(git status --porcelain)
if [[ -n $TMP ]];
@@ -108,7 +78,7 @@ eval $(gpg-agent --daemon) > /dev/null
## Extract project.artifactId and project.version from input parameters:

ProjectArtifactId=$1
ProjectVersion=$2
Tag=$2

# Determine the type of release / deployment we are dealing with
# and adjust the target directories and file version to be used in the file name accordingly.
@@ -121,7 +91,7 @@ ReleaseType=
FileVersion=
LeafDir=

if [[ $ProjectVersion =~ .*-SNAPSHOT ]];
if [[ $Tag =~ .*-SNAPSHOT ]];
then
echo
echo "This version is a SNAPSHOT. Do you still want to deploy?"
@@ -130,12 +100,12 @@ then
then
echo "Please correct the version string and rerun this script"
echo
exit
exit 1
fi
Snapshot=true
ReleaseType="SNAPSHOT"
FileVersion=${ProjectVersion%-SNAPSHOT}-$TIME # Remove SNAPSHOT, add date-time
LeafDir=$ProjectVersion
FileVersion=${Tag%-SNAPSHOT}-$TIME # Remove SNAPSHOT, add date-time
LeafDir=$Tag
#continue
else # NOT a SNAPSHOT
Snapshot=false
@@ -145,29 +115,29 @@ else # NOT a SNAPSHOT
if [[ $confirm != "y" ]];
then # NOT ReleaseCandidate, could be Final Release
ReleaseCandidate=false
echo "Please confirm that this the Final Release of $ProjectArtifactId : $ProjectVersion ? [y|N]"
echo "Please confirm that this the Final Release of $ProjectArtifactId : $Tag ? [y|N]"
read confirm
if [[ $confirm != "y" ]];
then # NOT Final Release either, bail out
Release=false
echo "Please correct the input and rerun this script"
echo
exit
exit 1

else # Final Release
Release=true
ReleaseType="Release"
FileVersion="$ProjectVersion"
LeafDir=$ProjectVersion
FileVersion="$Tag"
LeafDir=$Tag
#continue
fi
else # ReleaseCandidate
ReleaseCandidate=true
echo "What is the Release Candidate Number? NNN"
read RCNUM
ReleaseType="Release Candidate: RC$RCNUM"
FileVersion="$ProjectVersion"
LeafDir="$ProjectVersion-RC$RCNUM"
FileVersion="$Tag"
LeafDir="$Tag-RC$RCNUM"
#continue
fi
fi
@@ -178,7 +148,7 @@ fi
SubDir=$(expr "$ProjectArtifactId" : 'datasketches-\([a-z]*\)')

# Are we still incubating?
if [[ $ProjectVersion =~ .*-incubating.* ]]
if [[ $Tag =~ .*-incubating.* ]]
then
Incubating=true
Incubator="incubator/"
@@ -215,7 +185,7 @@ ZipName=apache-${ProjectArtifactId}-${FileVersion}-src.zip
echo
echo "===========SUMMARY OF INPUT PARAMETERS============="
echo "ProjectArtifactId : $ProjectArtifactId"
echo "Project Version : $ProjectVersion"
echo "Project Version : $Tag"
echo "Release Type : $ReleaseType"
echo "Incubating : $Incubating"
echo "File Version String : $FileVersion"
@@ -226,14 +196,15 @@ echo "FilesPath : $FilesPath"
echo "LocalSvnBasePath : $LocalSvnBasePath"
echo "RemoteSvnBasePath : $RemoteSvnBasePath"
echo "LocalFilesPath : $LocalFilesPath"

echo
echo "Please confirm if the above is correct: [y|N]"
read confirm
if [[ $confirm != "y" ]];
then
echo "Please correct the input and rerun this script"
echo
exit
exit 1
fi

# move to base path and checkout
@@ -259,7 +230,7 @@ then
echo
echo "Please correct the input and rerun this script"
echo
exit
exit 1
fi

#make the leaf directories
@@ -268,7 +239,9 @@ mkdir -p $LocalFilesPath
echo
echo "## Zip:"

scripts/createZip.sh $ZipName $LocalFilesPath
# ZIP
#scripts/createZip.sh $ZipName $LocalFilesPath
git archive --output="$LocalFilesPath"/$ZipName $Tag

echo
echo "Is the Zip file correct? [y|N]"
@@ -277,7 +250,7 @@ if [[ $confirm != "y" ]];
then
echo "Please correct the input and rerun this script"
echo
exit
exit 1
fi

cd $LocalFilesPath #for signing
@@ -351,7 +324,7 @@ then
echo "Please correct the input and rerun this script"
echo "You may have to manually remove some contents from Dist"
echo
exit
exit 1
fi
echo
echo "# SUCCESS"

0 comments on commit b0ca4bb

Please sign in to comment.