diff --git a/build.sbt b/build.sbt index 32b8a3be9..44a22326e 100644 --- a/build.sbt +++ b/build.sbt @@ -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") diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..38cfebc29 --- /dev/null +++ b/build.sh @@ -0,0 +1,33 @@ +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 Dr Elephant code with the script provided. An optional conf file can be passed in. +if [ -z "$1" ]; +then + bash ./compile.sh +else + bash ./compile.sh $1 +fi + +# 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"$BINTRAY_USER":"$BINTRAY_PASS" https://api.bintray.com/content/linkedin/maven/dr-elephant/"$VERSION"/com/linkedin/drelephant/$MODULE/"$VERSION"/ --verbose + +echo "Publishing the uploaded distribution" +curl -X POST -u"$BINTRAY_USER":"$BINTRAY_PASS" https://api.bintray.com/content/linkedin/maven/dr-elephant/"$VERSION"/publish --verbose \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index f40af3113..1bf5b0290 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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") diff --git a/public/assets/analytics/track.js b/public/assets/analytics/track.js index e5e099f45..bd2bdda08 100644 --- a/public/assets/analytics/track.js +++ b/public/assets/analytics/track.js @@ -1,6 +1,13 @@ -/* - Paste the tracking javascript snippet into this file for web analytics. - This javascript file will be included into every page in the application. - See comments section above 'enable.analytics' in the application.conf file for - more information. -*/ \ No newline at end of file + +// Piwik + var _paq = _paq || []; + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="//piwik.corp.linkedin.com/piwik/"; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', 86]); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); + })(); +// End Piwik Code