This file contains hidden or 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
| val config = new Properties() | |
| config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka:9092") | |
| val postProducer = Producer[Post](config) | |
| val post = Post(Id[Post]("post0"), Instant.now(), Id[User]("user0"), "Some text", URI.create("https://some-uri"), false) | |
| postProducer.send(post) | |
| postProducer.close() |
This file contains hidden or 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
| object PullRequestChecks { | |
| lazy val board = JobBoard[GitRef => Unit](JobId("pullRequestChecks"), "Pull Request Checks")( | |
| Input[GitRef]("Git ref") | |
| ) | |
| lazy val job = Job(board) { implicit workDir => gitRef => | |
| Github.statusUpdated(Repository("myOrganisation/backend"), gitRef) { implicit workDir => | |
| sh("./sbt test") | |
| } | |
| } |
This file contains hidden or 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
| object Orkestra extends OrkestraServer with GithubHooks { | |
| lazy val board = Folder("Orkestra")(PullRequestChecks.board) | |
| lazy val jobs = Set(PullRequestChecks.job) | |
| lazy val githubTriggers = Set( | |
| PullRequestTrigger(Repository("myOrganisation/myRepo"), PullRequestChecks.job)() | |
| ) | |
| } |
This file contains hidden or 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
| object CreateEnvironment { | |
| lazy val board = JobBoard[String => Unit](JobId("createEnvironment"), "Create Environment")( | |
| Input[String]("Environment name") | |
| ) | |
| lazy val job = Job(board) { implicit workDir => environmentName => | |
| Await.result(for { | |
| _ <- Kubernetes.client.namespaces.createOrUpdate(Namespace(environmentName)) | |
| _ <- Elasticsearch.deploy(environmentName) | |
| } yield (), 1.minute) |
This file contains hidden or 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
| object Orkestra extends OrkestraServer with GithubHooks { | |
| lazy val board = Folder("Orkestra")( | |
| PullRequestChecks.board, | |
| CreateEnvironment.board | |
| ) | |
| lazy val jobs = Set(PullRequestChecks.job, CreateEnvironment.job) | |
| lazy val githubTriggers = Set( | |
| PullRequestTrigger(Repository("myOrganisation/myRepo"), PullRequestChecks.job)() |
This file contains hidden or 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
| object DeployBackend { | |
| lazy val board = JobBoard[(String, String) => Unit](JobId("deployBackend"), "Deploy Backend")( | |
| Input[String]("Version"), | |
| Input[String]("Environment name") | |
| ) | |
| lazy val job = Job(board) { implicit workDir => (version, environmentName) => | |
| Await.result(DeployBackend(version, environmentName), 1.minute) | |
| } | |
| } |
This file contains hidden or 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
| object PublishBackend { | |
| lazy val board = JobBoard[(GitRef, Boolean) => String](JobId("publishBackend"), "Publish Backend")( | |
| Input[GitRef]("Git ref"), | |
| Checkbox("Run checks") | |
| ) | |
| lazy val job = Job(board) { implicit workDir => (gitRef, runChecks) => | |
| Await.result(PublishBackend(gitRef, runChecks), 1.hour) | |
| } | |
| } |
This file contains hidden or 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
| object Orkestra extends OrkestraServer with GithubHooks { | |
| lazy val board = Folder("Orkestra")( | |
| PullRequestChecks.board, | |
| CreateEnvironment.board, | |
| PublishBackend.board, | |
| DeployBackend.board, | |
| PublishAndDeploy.board | |
| ) | |
| lazy val jobs = Set( |
This file contains hidden or 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
| object PublishAndDeploy { | |
| lazy val board = | |
| JobBoard[(GitRef, Boolean, String) => Unit]( | |
| JobId("publishAndDeployBackend"), | |
| "Publish and Deploy Backend" | |
| )( | |
| Input[GitRef]("Git ref"), | |
| Checkbox("Run checks", checked = true), | |
| Input[String]("Environment name") | |
| ) |
This file contains hidden or 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
| object CopyData { | |
| lazy val board = JobBoard[(String, String) => Unit](JobId("copyData"), "Copy Data")( | |
| Input[String]("Source environment"), | |
| Input[String]("Destination environment") | |
| ) | |
| lazy val job = Job(board) { implicit workDir => (source, destination) => | |
| Await.result(copyData(source, destination), 1.minute) | |
| } | |
| } |