Merge pull request #3672 from RomanIakovlev/1.x

Add new setting to determine if running in CI env
This commit is contained in:
Dale Wijnand 2017-10-28 00:28:44 +01:00 committed by GitHub
commit bb6d8d62ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 6 deletions

View File

@ -273,6 +273,7 @@ object Defaults extends BuildCommon {
.toHex(Hash(appConfiguration.value.baseDirectory.toString))
.## % 1000),
serverAuthentication := Set(ServerAuthentication.Token),
insideCI :== sys.env.contains("BUILD_NUMBER") || sys.env.contains("CI"),
))
def defaultTestTasks(key: Scoped): Seq[Setting[_]] =
@ -1749,12 +1750,10 @@ object Classpaths {
dependencyOverrides :== Vector.empty,
libraryDependencies :== Nil,
excludeDependencies :== Nil,
ivyLoggingLevel :== {
// This will suppress "Resolving..." logs on Jenkins and Travis.
if (sys.env.get("BUILD_NUMBER").isDefined || sys.env.get("CI").isDefined)
UpdateLogging.Quiet
else UpdateLogging.Default
},
ivyLoggingLevel := (// This will suppress "Resolving..." logs on Jenkins and Travis.
if (insideCI.value)
UpdateLogging.Quiet
else UpdateLogging.Default),
ivyXML :== NodeSeq.Empty,
ivyValidate :== false,
moduleConfigurations :== Nil,

View File

@ -445,6 +445,7 @@ object Keys {
val skip = taskKey[Boolean]("For tasks that support it (currently only 'compile' and 'update'), setting skip to true will force the task to not to do its work. This exact semantics may vary by task.").withRank(BSetting)
val templateResolverInfos = settingKey[Seq[TemplateResolverInfo]]("Template resolvers used for 'new'.").withRank(BSetting)
val interactionService = taskKey[InteractionService]("Service used to ask for user input through the current user interface(s).").withRank(CTask)
val insideCI = SettingKey[Boolean]("insideCI", "Determines if the SBT is running in a Continuous Integration environment", AMinusSetting)
// special
val sessionVars = AttributeKey[SessionVar.Map]("sessionVars", "Bindings that exist for the duration of the session.", Invisible)

View File

@ -0,0 +1,7 @@
name := "inside-ci"
organization := "org.example"
val t = taskKey[Boolean]("inside-ci")
t := insideCI.value

View File

@ -0,0 +1,2 @@
# just need to verify it loads
> help