Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ playJavaSettings
scalaVersion := "2.10.4"

envVars in Test := Map("PSO_DIR_PATH" -> (baseDirectory.value / "scripts/pso").getAbsolutePath)

licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))

bintrayOrganization := Some("linkedin")
27 changes: 27 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BUILD_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

# Enable analytics in the conf file.
sed -i.bak 's/^enable_analytics=false$/enable_analytics=true/' $BUILD_PATH/app-conf/elephant.conf
rm -rf "$BUILD_PATH"/app-conf/elephant.conf.bak

cd $BUILD_PATH/

# Compile the Dr Elephant code
bash ./compile.sh

# Generate the pom file (other artifacts are disabled) and publish to bintray
sbt clean 'set publishArtifact in (Compile, packageBin) := false' 'set publishArtifact in (Compile, packageDoc) := false' 'set publishArtifact in (Compile, packageSrc) := false' publish

MODULE=dr-elephant_2.10

VERSION=`sed -n 's/.*version := \"\([^"]*\)\".*/\1/p' $BUILD_PATH/build.sbt`

mv $BUILD_PATH/dist/dr-elephant*.zip $BUILD_PATH/dist/$MODULE-$VERSION.zip

cd dist/

echo "Uploading the distribution to bintray"
curl -T $MODULE-"$VERSION".zip -u"$1":"$2" https://api.bintray.com/content/linkedin/maven/dr-elephant/"$VERSION"/com/linkedin/drelephant/$MODULE/"$VERSION"/ --verbose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, $1 and $2 are the username and API key for publishing to Bintray, try to declare them in the Environment variables and use them here, so user not need to provide this information every time they execute this script.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR has been updated to get the values of username and API key from environment variables.


echo "Publishing the uploaded distribution"
curl -X POST -u"$1":"$2" https://api.bintray.com/content/linkedin/maven/dr-elephant/"$VERSION"/publish --verbose
3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ addSbtPlugin("com.typesafe.play" % "sbt-plugin" % Option(System.getProperty("pla

// Jacoco code coverage plugin
addSbtPlugin("de.johoop" % "jacoco4sbt" % "2.1.6")

// An sbt plugin for publishing bintray packages.
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")