-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #421 from iRevive/sdk-exporter/otlp-http
sdk-exporter-trace: add `OtlpHttpSpanExporter`
- Loading branch information
Showing
25 changed files
with
2,684 additions
and
11 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
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
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,60 @@ | ||
import sbt._ | ||
import sbt.Keys._ | ||
|
||
import scala.sys.process._ | ||
|
||
object DockerComposeEnvPlugin extends AutoPlugin { | ||
|
||
override def trigger = noTrigger | ||
|
||
object autoImport { | ||
lazy val dockerComposeEnvStart = | ||
taskKey[Unit]("Start local docker compose environment") | ||
lazy val dockerComposeEnvStop = | ||
taskKey[Unit]("Stop local docker compose environment") | ||
lazy val dockerComposeEnvTestOpts = | ||
taskKey[Seq[TestOption]]("Setup and cleanup options") | ||
lazy val dockerComposeEnvFile = | ||
settingKey[File]("The docker compose file to use") | ||
} | ||
|
||
import autoImport._ | ||
|
||
override def projectSettings: Seq[Setting[_]] = | ||
Seq( | ||
dockerComposeEnvStart := { | ||
val projectName = name.value | ||
val file = dockerComposeEnvFile.value | ||
val log = streams.value.log | ||
|
||
start(projectName, file, log) | ||
}, | ||
dockerComposeEnvStop := { | ||
val projectName = name.value | ||
val file = dockerComposeEnvFile.value | ||
val log = streams.value.log | ||
|
||
stop(projectName, file, log) | ||
}, | ||
Test / testOptions := { | ||
val projectName = name.value | ||
val file = dockerComposeEnvFile.value | ||
val log = streams.value.log | ||
|
||
val setup = Tests.Setup(() => start(projectName, file, log)) | ||
|
||
Seq(setup) | ||
} | ||
) | ||
|
||
private def start(projectName: String, file: File, log: Logger): Unit = { | ||
log.info(s"Project [$projectName]. Creating integration environment") | ||
s"docker compose -f $file -p $projectName up -d".! | ||
} | ||
|
||
private def stop(projectName: String, file: File, log: Logger): Unit = { | ||
log.info(s"Project [$projectName]. Terminating integration environment") | ||
s"docker compose -f $file -p $projectName down".! | ||
} | ||
|
||
} |
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
Oops, something went wrong.