-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Kevin-Lee/prepare-for-0.0.12
Preparation for 0.0.12
- Loading branch information
Showing
18 changed files
with
1,353 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "$1" ] | ||
then | ||
export GIT_TAG="v$1" | ||
else | ||
export GIT_TAG="v$TRAVIS_BUILD_NUMBER" | ||
fi | ||
echo "GIT_TAG=$GIT_TAG" | ||
|
||
echo "check: git ls-remote --exit-code --tags origin $GIT_TAG 2>&1 > /dev/null" | ||
|
||
if git ls-remote --exit-code --tags origin $GIT_TAG 2>&1 > /dev/null ; then | ||
echo "the given tag: '$GIT_TAG' already exists so skip it!" | ||
else | ||
echo "the given tag: '$GIT_TAG' does not exist so run it!" | ||
git config --global user.email "kevin.code@lckymn.com" | ||
git config --global user.name "Kecin-CI" | ||
|
||
git tag $GIT_TAG -a -m "Automatically generated tag by Travis CI for build $TRAVIS_BUILD_NUMBER" | ||
git push git@github.com:Kevin-Lee/j8plus --tags | ||
|
||
echo "======================================================" | ||
echo "ls -l target/scala-2.11/j8plus_*.jar" | ||
ls -l target/scala-2.11/j8plus_*.jar | ||
echo "======================================================" | ||
echo "Create a folder to put all the binary files." | ||
echo "------------------------------------------------------" | ||
echo "mkdir -p target/all-bin" | ||
mkdir -p target/all-bin | ||
echo "ls -l target/all-bin" | ||
ls -l target/all-bin | ||
|
||
echo "------------------------------------------------------" | ||
echo "cp target/scala-2.11/j8plus_*.jar target/all-bin/" | ||
cp target/scala-2.11/j8plus_*.jar target/all-bin/ | ||
echo "------------------------------------------------------" | ||
echo "ls -lR target/all-bin" | ||
ls -lR target/all-bin | ||
echo "------------------------------------------------------" | ||
echo "Copying all binary files to 'target/all-bin': Done!" | ||
echo "======================================================" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash -e | ||
|
||
echo "======================================================" | ||
echo "Build packages" | ||
echo "------------------------------------------------------" | ||
|
||
echo "" | ||
echo "======================================================" | ||
echo "Run: sbt package writeVersion " | ||
echo "------------------------------------------------------" | ||
if sbt clean package writeVersion ; then | ||
echo "Done: sbt clean package writeVersion " | ||
echo "======================================================" | ||
else | ||
echo "Failed: sbt package" 1>&2 | ||
echo "======================================================" | ||
exit 1 | ||
fi | ||
|
||
echo "" | ||
echo "======================================================" | ||
echo "Building Packages: Done" | ||
echo "======================================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash -e | ||
|
||
echo "============================================" | ||
echo "Build projects" | ||
echo "--------------------------------------------" | ||
echo "" | ||
echo "============================================" | ||
echo "Run: sbt clean coverage test package" | ||
echo "--------------------------------------------" | ||
if sbt clean coverage test package ; then | ||
echo "Done: sbt clean coverage test package" | ||
echo "============================================" | ||
else | ||
echo "Failed: sbt clean coverage test package" 1>&2 | ||
echo "============================================" | ||
exit 1 | ||
fi | ||
|
||
echo "" | ||
|
||
# echo "============================================" | ||
# echo "Run: sbt coveralls" | ||
# echo "--------------------------------------------" | ||
# if sbt coveralls ; then | ||
# echo "Done: sbt coveralls" | ||
# echo "============================================" | ||
# else | ||
# echo "Failed: sbt coveralls" 1>&2 | ||
# echo "============================================" | ||
# exit 1 | ||
# fi | ||
# echo "" | ||
echo "============================================" | ||
echo "Building projects: Done" | ||
echo "============================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash -e | ||
|
||
echo "======================================================" | ||
echo "Deploying to GitHub" | ||
if sbt checkGithubCredentials releaseOnGithub ; then | ||
echo "------------------------------------------------------" | ||
echo "Deploying to GitHub: Done" | ||
echo "======================================================" | ||
# echo "======================================================" | ||
# echo "Uploading to S3" | ||
# if sbt s3-upload ; then | ||
# echo "------------------------------------------------------" | ||
# echo "Uploading to S3: Done" | ||
# echo "======================================================" | ||
# else | ||
# echo "======================================================" | ||
# echo "Build and Deploy: Failed" 1>&2 | ||
# echo "======================================================" | ||
# exit 1 | ||
# fi | ||
else | ||
echo "======================================================" | ||
echo "Build and Deploy: Failed" 1>&2 | ||
echo "======================================================" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -e | ||
|
||
echo "============================================" | ||
echo "Java Info" | ||
java -version | ||
echo "--------------------------------------------" | ||
echo "Scala Info" | ||
scala -version | ||
echo "--------------------------------------------" | ||
echo "SBT Info" | ||
sbt --version || : | ||
echo "--------------------------------------------" | ||
echo "Memory Info" | ||
echo "--------------------------------------------" | ||
echo "free -m" | ||
free -m | ||
echo "--------------------------------------------" | ||
echo "grep MemTotal /proc/meminfo" | ||
grep MemTotal /proc/meminfo | ||
echo "--------------------------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -n "$PROJECT_BUILD_NAME" ] | ||
then | ||
echo "NO PROJECT_BUILD_NAME is found so quit!" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
echo "======================================================" | ||
echo "Release to Bintray" | ||
echo "======================================================" | ||
echo "" | ||
echo "Run: sbt publish" | ||
echo "------------------------------------------------------" | ||
if sbt publish ; then | ||
echo "Done: sbt publish" | ||
else | ||
echo "Failed: sbt publish" 1>&2 | ||
exit 1 | ||
fi | ||
echo "======================================================" | ||
|
||
|
||
echo "======================================================" | ||
echo "Copy packaged files to deploy" | ||
echo "======================================================" | ||
echo "ls -l target/*.jar" | ||
ls -l target/*.jar | ||
echo "" | ||
echo "======================================================" | ||
if [ -d "target/ci" ]; then | ||
echo "Clean up existing target/ci/*" | ||
echo "rm -R target/ci/*" | ||
rm -R target/ci/* | ||
echo "------------------------------------------------------" | ||
fi | ||
echo "Create a folder to put all the binary files." | ||
echo "------------------------------------------------------" | ||
echo "mkdir -p target/ci/$PROJECT_BUILD_NAME" | ||
mkdir -p "target/ci/$PROJECT_BUILD_NAME" | ||
echo "ls -l target/ci/$PROJECT_BUILD_NAME" | ||
ls -l "target/ci/$PROJECT_BUILD_NAME" | ||
|
||
echo "------------------------------------------------------" | ||
echo "cp target/*.jar target/ci/$PROJECT_BUILD_NAME/" | ||
cp target/*.jar "target/ci/$PROJECT_BUILD_NAME/" | ||
echo "------------------------------------------------------" | ||
echo "ls -lR target/ci/$PROJECT_BUILD_NAME/" | ||
ls -lR "target/ci/$PROJECT_BUILD_NAME" | ||
echo "------------------------------------------------------" | ||
echo "Copying all binary files to 'target/ci', Done!" | ||
echo "======================================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
echo "Create $HOME/.ivy2 if not exists" | ||
mkdir -p "$HOME/.ivy2" | ||
echo "Done" | ||
# ls -l "$HOME/.ivy2" | ||
# ls -l "$HOME/.ivy2/cache" | ||
echo "" | ||
echo "Create $HOME/.sbt if not exists" | ||
mkdir -p "$HOME/.sbt" | ||
echo "Done" | ||
# ls -l "$HOME/.sbt" | ||
|
||
if [ -d "$SEMAPHORE_CACHE_DIR/app-ivy2-cache" ]; | ||
then | ||
echo "============================================" | ||
echo "Ivy Cache exists so copy it" | ||
echo "--------------------------------------------" | ||
echo "cp -Rp $SEMAPHORE_CACHE_DIR/app-ivy2-cache/cache $HOME/.ivy2/" | ||
cp -Rp "$SEMAPHORE_CACHE_DIR/app-ivy2-cache/cache" "$HOME/.ivy2/" | ||
|
||
echo "ls -ld $HOME/.ivy2/cache" | ||
ls -ld "$HOME/.ivy2/cache" | ||
echo "ls -l $HOME/.ivy2/cache" | ||
ls -l "$HOME/.ivy2/cache" | ||
echo "--------------------------------------------" | ||
echo "Ivy Cache Copying: Done" | ||
echo "============================================" | ||
fi | ||
if [ -d "$SEMAPHORE_CACHE_DIR/app-sbt-cache" ]; | ||
then | ||
echo "============================================" | ||
echo "SBT Cache exists so copy it" | ||
echo "--------------------------------------------" | ||
echo "cp -Rp $SEMAPHORE_CACHE_DIR/app-sbt-cache/boot $HOME/.sbt/" | ||
cp -Rp "$SEMAPHORE_CACHE_DIR/app-sbt-cache/boot" "$HOME/.sbt/" | ||
|
||
echo "ls -ld $HOME/.sbt/boot" | ||
ls -ld "$HOME/.sbt/boot" | ||
echo "ls -l $HOME/.sbt/boot" | ||
ls -l "$HOME/.sbt/boot" | ||
echo "--------------------------------------------" | ||
echo "SBT Cache Copying: Done" | ||
echo "============================================" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/bin/bash -e | ||
|
||
echo "" | ||
echo "======================================================" | ||
echo "Start to deploy packages" | ||
echo "------------------------------------------------------" | ||
|
||
export THIS_BRANCH="$BRANCH_NAME" | ||
if [ "$THIS_BRANCH" == "release" ]; | ||
then | ||
|
||
export VERSION_FILE="target/version.tmp" | ||
echo "Version File=$VERSION_FILE" | ||
|
||
if [ ! -f "$VERSION_FILE" ] | ||
then | ||
echo "NO version file, '$VERSION_FILE', exists so quit!" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
export PROJECT_VERSION=`cat $VERSION_FILE` | ||
echo "PROJECT_VERSION=$PROJECT_VERSION" | ||
|
||
if [ ! -n "$PROJECT_VERSION" ] | ||
then | ||
echo "NO PROJECT_VERSION is found so quit!" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
export GIT_TAG="v$PROJECT_VERSION" | ||
echo "GIT_TAG=$GIT_TAG" | ||
export PROJECT_BUILD_NAME="$GIT_TAG" | ||
echo "PROJECT_BUILD_NAME=$PROJECT_BUILD_NAME" | ||
|
||
echo "======================================================" | ||
echo "Running: git tag | xargs -n1 git tag -d" | ||
echo "------------------------------------------------------" | ||
git tag | xargs -n1 git tag -d | ||
echo "======================================================" | ||
echo "Running: git fetch --tags" | ||
echo "------------------------------------------------------" | ||
git fetch --tags | ||
echo "======================================================" | ||
|
||
echo "check git ls-remote --exit-code --tags origin $GIT_TAG 2>&1 > /dev/null" | ||
|
||
if git ls-remote --exit-code --tags origin $GIT_TAG 2>&1 > /dev/null ; then | ||
echo "------------------------------------------------------" | ||
echo "[ERROR] the given tag '$GIT_TAG' already exists!" 2>&1 | ||
echo "======================================================" | ||
exit 1 | ||
else | ||
echo "------------------------------------------------------" | ||
echo "the given tag '$GIT_TAG' does not exist so run it!" | ||
|
||
export REPO_LOCATION="git@github.com:Kevin-Lee/j8plus.git" | ||
echo "REPO_LOCATION=$REPO_LOCATION" | ||
|
||
export USER_EMAIL="builder+github@lckymn.com" | ||
echo "USER_EMAIL=$USER_EMAIL" | ||
|
||
export USER_NAME="Kevin-App-Builder" | ||
echo "USER_NAME=$USER_NAME" | ||
|
||
git config --global user.email "$USER_EMAIL" | ||
git config --global user.name "$USER_NAME" | ||
|
||
echo "======================================================" | ||
echo "Running: git tag $GIT_TAG -a -m Automatically generated tag by Semaphore CI for $GIT_TAG" | ||
echo "------------------------------------------------------" | ||
git tag "$GIT_TAG" -a -m "Automatically generated tag by Semaphore CI for $GIT_TAG" | ||
echo "======================================================" | ||
echo "git push $REPO_LOCATION --tags" | ||
echo "------------------------------------------------------" | ||
git push "$REPO_LOCATION" --tags | ||
echo "======================================================" | ||
|
||
fi | ||
|
||
./.release-files-copy.sh | ||
./.deploy-to-github.sh | ||
|
||
echo "======================================================" | ||
echo "Build and Deploy: Done" | ||
echo "======================================================" | ||
else | ||
echo "======================================================" | ||
echo "It is not release branch so skip deployment." | ||
echo "Build: Done" | ||
echo "======================================================" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
find $HOME/.sbt -name "*.lock" | xargs rm | ||
find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm | ||
|
||
echo "============================================" | ||
echo "Copy Ivy cache to $SEMAPHORE_CACHE_DIR/app-ivy2-cache" | ||
echo "--------------------------------------------" | ||
if [ ! -d "$SEMAPHORE_CACHE_DIR/app-ivy2-cache" ]; | ||
then | ||
echo "mkdir -p $SEMAPHORE_CACHE_DIR/app-ivy2-cache" | ||
mkdir -p "$SEMAPHORE_CACHE_DIR/app-ivy2-cache" | ||
fi | ||
cp -Rp "$HOME/.ivy2/cache" "$SEMAPHORE_CACHE_DIR/app-ivy2-cache/" | ||
echo "Copy Ivy cache to $SEMAPHORE_CACHE_DIR/app-ivy2-cache: Done" | ||
echo "============================================" | ||
echo "Copy Sbt cache to $SEMAPHORE_CACHE_DIR/app-sbt-cache" | ||
echo "--------------------------------------------" | ||
if [ ! -d "$SEMAPHORE_CACHE_DIR/app-sbt-cache" ]; | ||
then | ||
echo "mkdir -p $SEMAPHORE_CACHE_DIR/app-sbt-cache " | ||
mkdir -p "$SEMAPHORE_CACHE_DIR/app-sbt-cache" | ||
fi | ||
cp -Rp "$HOME/.sbt/boot" "$SEMAPHORE_CACHE_DIR/app-sbt-cache/" | ||
echo "Copy Sbt cache to $SEMAPHORE_CACHE_DIR/app-sbt-cache: Done" | ||
echo "============================================" |
Oops, something went wrong.