Skip to content

Commit

Permalink
Merge pull request #10961 from mkurz/fix_cron_jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
octonato committed Aug 27, 2021
2 parents 71707c5 + 6f3bd35 commit 619b319
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 26 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ language: scala
# https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
if: type != push OR tag IS present OR repo != playframework/playframework OR branch IN (master, 2.8.x, 2.7.x, 2.6.x)

addons:
apt:
packages:
# Install xmllint used to get Akka HTTP version
- libxml2-utils
git:
depth: false # Avoid sbt-dynver not seeing the tag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ object ScriptedTools extends AutoPlugin {
// the snapshot resolvers in `cron` builds.
// If this is a cron job in Travis:
// https://docs.travis-ci.com/user/cron-jobs/#detecting-builds-triggered-by-cron
resolvers ++= (sys.env.get("TRAVIS_EVENT_TYPE").filter(_.equalsIgnoreCase("cron")) match {
case Some(_) =>
Seq(
"akka-snapshot-repository".at("https://repo.akka.io/snapshots"),
"akka-http-snapshot-repository".at("https://oss.sonatype.org/content/repositories/snapshots")
)
case None => Seq.empty
})
resolvers ++= sys.env
.get("TRAVIS_EVENT_TYPE")
.filter(_.equalsIgnoreCase("cron"))
.map(_ => Resolver.sonatypeRepo("snapshots")) // contains akka(-http) snapshots
.toSeq
)

def callIndex(): Unit = callUrl("/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ libraryDependencies += "org.scala-stm" %% "scala-stm" % "0.9.1"
//#auto-scala-version-dep

//#resolver
resolvers += "sonatype snapshots".at("https://oss.sonatype.org/content/repositories/snapshots/")
resolvers += Resolver.sonatypeRepo("snapshots")
//#resolver

//#local-maven-repos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ object Common {
val playSettings = settings ++ Seq(
routesGenerator := InjectedRoutesGenerator,
libraryDependencies += specs2 % Test,
resolvers += "akka-http-snapshot-repository" at "https://oss.sonatype.org/content/repositories/snapshots"
resolvers += Resolver.sonatypeRepo("snapshots") // contains akka(-http) snapshots
)
}
```
Expand Down
13 changes: 5 additions & 8 deletions project/AkkaSnapshotRepositories.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ object AkkaSnapshotRepositories extends AutoPlugin {
override def projectSettings: Seq[Def.Setting[_]] = {
// If this is a cron job in Travis:
// https://docs.travis-ci.com/user/cron-jobs/#detecting-builds-triggered-by-cron
resolvers ++= (sys.env.get("TRAVIS_EVENT_TYPE").filter(_.equalsIgnoreCase("cron")) match {
case Some(_) =>
Seq(
"akka-snapshot-repository".at("https://repo.akka.io/snapshots"),
"akka-http-snapshot-repository".at("https://oss.sonatype.org/content/repositories/snapshots/")
)
case None => Seq.empty
})
resolvers ++= sys.env
.get("TRAVIS_EVENT_TYPE")
.filter(_.equalsIgnoreCase("cron"))
.map(_ => Resolver.sonatypeRepo("snapshots")) // contains akka(-http) snapshots
.toSeq
}
}
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import buildinfo.BuildInfo

object Dependencies {
val akkaVersion: String = sys.props.getOrElse("akka.version", "2.6.14")
val akkaHttpVersion = "10.1.14"
val akkaHttpVersion = sys.props.getOrElse("akka.http.version", "10.1.14")

val sslConfig = "com.typesafe" %% "ssl-config-core" % "0.4.3"

Expand Down
4 changes: 2 additions & 2 deletions scripts/scriptLib
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then
if [ -f $HOME/.ivy2/local/com.typesafe.play/AKKA_VERSION ]; then
AKKA_VERSION=$(cat $HOME/.ivy2/local/com.typesafe.play/AKKA_VERSION)
else
AKKA_VERSION=$(curl -s https://repo.akka.io/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -oEi '2\.6\.[0-9]+\+[0-9]+-[0-9a-f]{8}' | sort -V | tail -n 1)
AKKA_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -oEi '2\.6\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1)
fi
if [ -f $HOME/.ivy2/local/com.typesafe.play/AKKA_HTTP_VERSION ]; then
AKKA_HTTP_VERSION=$(cat $HOME/.ivy2/local/com.typesafe.play/AKKA_HTTP_VERSION)
else
AKKA_HTTP_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-http-core_2.13/maven-metadata.xml | xmllint --xpath '//latest/text()' -)
AKKA_HTTP_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-http-core_2.13/ | grep -oEi '10\.1\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1)
fi

echo "Using Akka SNAPSHOT ${AKKA_VERSION} and Akka HTTP SNAPSHOT ${AKKA_HTTP_VERSION}"
Expand Down

0 comments on commit 619b319

Please sign in to comment.