Can't deploy to Heroku with Play RC Snapshot(Typesafe snapshots) Slug to big

377 views
Skip to first unread message

Drew Hamlett

unread,
Feb 12, 2012, 9:25:10 PM2/12/12
to play-framework
Here is my plugins.sbt


logLevel := Level.Warn

resolvers ++= Seq(
DefaultMavenRepository,
Resolver.url("Play", url("http://download.playframework.org/ivy-
releases/"))(Resolver.ivyStylePatterns),
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/
releases/",
"Typesafe snapshots" at "http://repo.typesafe.com/typesafe/
snapshots/"
)

addSbtPlugin("play" % "sbt-plugin" % "2.0-RC1-SNAPSHOT")


And my Build.scala



val appDependencies = Seq(
"mysql" % "mysql-connector-java" % "5.1.18",
"org.apache.commons" % "commons-email" % "1.2",
"c3p0" % "c3p0" % "0.9.1.2"

)

val main = PlayProject(appName, appVersion, appDependencies,
mainLang = SCALA).settings(
// Add your own project settings here
)


This puts me around 111mb on heroku. You can't go over 100mb. My
entire app directory is only 1.5mb. Is there something I can do to
reduce the size? Thanks for the help.

scott clasen

unread,
Feb 13, 2012, 1:27:28 PM2/13/12
to play-fr...@googlegroups.com
Hi Drew-


    Currently Play 2 is supported on Heroku via scala/sbt support. The current sbt support includes the ivy cache in the slug, and play's stage task also copies all the app dependencies from the ivy cache to target. 

So you are getting quite a few duplicated and unneeded dependencies...since the ivy cache isnt required for play 2.

The scala buildpack is here


Take a look at the hacking section of the readme, it shows how you could fork the buildpack and drop the ivy cache from your slug.

Just fork the buildpack, make the change and then set a BUILDPACK_URL in your heroku config


and the push your app again....the slug should be much smaller.


Let me know if you have any more questions/issues

Thanks
SC 





zka

unread,
Feb 14, 2012, 2:49:33 AM2/14/12
to play-framework
Hello,

The problem is that the ivy cache would be regenerated on each deploy

it's take a while :(

scott clasen

unread,
Feb 14, 2012, 2:40:39 PM2/14/12
to play-fr...@googlegroups.com
zka, no the cache will be maintained, the ivy repo just wont be included in your slug. The cache can be bigger than 100mb but not the slug.

Drew Hamlett

unread,
Feb 15, 2012, 8:57:53 AM2/15/12
to play-framework
Hi Scott thanks for your help. This worked! Just to specify to
everyone the line goes like this.


for DIR in $CACHED_DIRS ; do
rm -rf $CACHE_DIR/$DIR
mkdir -p $CACHE_DIR/$DIR
cp -r $DIR/. $CACHE_DIR/$DIR
echo "-----> Dropping ivy cache from the slug"
rm -rf $SBT_USER_HOME/.ivy2
done

The hacking section has the line like this.


# AFTER THE LINE THAT READS
# cp -r --no-target-directory $DIR $CACHE_DIR/$DIR
echo "-----> Dropping ivy cache from the slug"
rm -rf $SBT_USER_HOME/.ivy2

May need to be updated.


Also use http instead of https when specifying github repository.

Thanks

scott clasen

unread,
Feb 15, 2012, 3:41:41 PM2/15/12
to play-fr...@googlegroups.com
Great to hear Drew!

I have updated the hacking section.  Thanks Again!
Reply all
Reply to author
Forward
0 new messages