Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a hatchet task to run the hatchet suite setup the travis matrix added heroku api key to travis added a build props file tweaked thing to get travis passing moved jruby dep into plugins cleaned up the jruby config shorted a dir reference
- Loading branch information
Showing
12 changed files
with
123 additions
and
3 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 |
---|---|---|
@@ -1 +1,16 @@ | ||
spec/fixtures/repos/* | ||
logs | ||
project/project | ||
project/target | ||
target | ||
tmp | ||
.history | ||
dist | ||
/.idea | ||
/*.iml | ||
/out | ||
/.idea_modules | ||
/.classpath | ||
/.project | ||
/RUNNING_PID | ||
/.settings |
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 |
---|---|---|
@@ -1,8 +1,29 @@ | ||
env: | ||
- SHUNIT_HOME="/tmp/shunit2-2.1.6" | ||
language: scala | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
before_install: | ||
- curl --silent https://shunit2.googlecode.com/files/shunit2-2.1.6.tgz | tar xz -C /tmp/ | ||
- git clone https://github.com/ryanbrainard/heroku-buildpack-testrunner.git /tmp/testrunner | ||
- ./etc/hatchet_travis_setup.sh | ||
|
||
install: true | ||
|
||
script: /tmp/testrunner/bin/run -c . | ||
script: $TEST_CMD | ||
|
||
after_script: heroku keys:remove ~/.ssh/id_rsa | ||
|
||
env: | ||
global: | ||
- IS_RUNNING_ON_TRAVIS=true | ||
- HATCHET_RETRIES=3 | ||
- HATCHET_DEPLOY_STRATEGY=git | ||
- HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-scala.git" | ||
- SHUNIT_HOME="/tmp/shunit2-2.1.6" | ||
# HEROKU_API_KEY | ||
- secure: gR5b3OjggCuZ5E/UuxZHgz5WU7LRkyFwGLB5osPOcbuyxSGxl9gRd18TyTNkwEIDX0z+kcYjnbZVXF+Z8YpTGpkR9FieWY7sWUlb7VqHV6Bc1ZRMekinOR9L9N8Al6fLvXqHRQUrstG6/V4Zx2ylgQUqQOqUhvOexcF5Hh3s964= | ||
matrix: | ||
- TEST_CMD="sbt hatchet" | ||
- TEST_CMD="/tmp/testrunner/bin/run -c ." |
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,42 @@ | ||
name := "heroku-buildpack-scala" | ||
|
||
resolvers += | ||
"rubygems-release" at "http://rubygems-proxy.torquebox.org/releases" | ||
|
||
libraryDependencies ++= Seq( | ||
"rubygems" % "thor" % "0.15.4", | ||
"rubygems" % "rspec-retry" % "0.3.0", | ||
"rubygems" % "heroku_hatchet" % "1.3.4" excludeAll(ExclusionRule("rubygems", "thor")), | ||
"rubygems" % "rspec" % "3.0.0" | ||
) | ||
|
||
val hatchet = taskKey[Unit]("Run the suite of Hatchet specs") | ||
|
||
val Hatchet = config("hatchet") | ||
|
||
def jruby(rubyGemsHome: File): org.jruby.Main = { | ||
val ruby = new org.jruby.RubyInstanceConfig() | ||
val env = ruby.getEnvironment.asInstanceOf[java.util.Map[String,String]] | ||
val newEnv = new java.util.HashMap[String, String] | ||
newEnv.putAll(env) | ||
newEnv.put("GEM_HOME", rubyGemsHome.getAbsolutePath) | ||
newEnv.put("GEM_PATH", rubyGemsHome.getAbsolutePath) | ||
ruby.setEnvironment(newEnv) | ||
new org.jruby.Main(ruby) | ||
} | ||
|
||
hatchet := { | ||
val rubyGemsHome = target.value / "rubygems" | ||
IO.createDirectory(rubyGemsHome) | ||
val oldContextClassLoader = Thread.currentThread.getContextClassLoader | ||
Thread.currentThread.setContextClassLoader(this.getClass.getClassLoader) | ||
(update in Hatchet).value.allFiles.foreach { f => | ||
if (f.getName.endsWith(".gem")) { | ||
jruby(rubyGemsHome).run(List("-S", "gem", "install", f.getAbsolutePath, "-f", "-l", "-i", rubyGemsHome.getAbsolutePath).toArray[String]) | ||
} | ||
} | ||
val rubyGemsBin = rubyGemsHome / "bin" | ||
jruby(rubyGemsHome).run(List("-S", rubyGemsBin.getAbsolutePath + "/hatchet", "install").toArray[String]) | ||
jruby(rubyGemsHome).run(List("-S", rubyGemsBin.getAbsolutePath + "/rspec").toArray[String]) | ||
Thread.currentThread.setContextClassLoader(oldContextClassLoader) | ||
} |
File renamed without changes.
File renamed without changes.
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,21 @@ | ||
if [ "$TEST_CMD" == "sbt hatchet" ]; then | ||
if [ -n "`git config --get user.email`" ]; then | ||
echo 'already set'; else `git config --global user.email 'buildpack@example.com'` | ||
fi | ||
if [ -n "`git config --get user.name`" ]; then | ||
echo 'already set'; else `git config --global user.name 'BuildpackTester'` | ||
fi | ||
|
||
cat <<EOF > ~/.ssh/config | ||
Host heroku.com | ||
StrictHostKeyChecking no | ||
CheckHostIP no | ||
UserKnownHostsFile=/dev/null | ||
Host github.com | ||
StrictHostKeyChecking no | ||
EOF | ||
|
||
curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://toolbelt.heroku.com/install-ubuntu.sh | sh | ||
|
||
yes | heroku keys:add | ||
fi |
File renamed without changes.
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
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 @@ | ||
sbt.version=0.13.5 |
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 @@ | ||
libraryDependencies += "org.jruby" % "jruby-complete" % "1.7.12" |
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,15 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe "Lift" do | ||
it "should not download pre-cached dependencies" do | ||
Hatchet::Runner.new("lift-2.5-sample").deploy do |app| | ||
# expect(app.output).to match("Running: sbt update") | ||
expect(app.output).to match("Running: sbt compile stage") | ||
expect(app.output).not_to match(/Priming Ivy cache/) | ||
|
||
expect(app.output).to match("downloading http://repo1.maven.org/maven2/com/github/jsimone/webapp-runner") | ||
|
||
expect(successful_body(app)).to match("Welcome, you now have a working Lift installation") | ||
end | ||
end | ||
end |
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