-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
114 additions
and
34 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
39 changes: 39 additions & 0 deletions
39
04-helper/src/main/scala/camundala/helper/dev/deploy/DeployHelper.scala
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,39 @@ | ||
package camundala.helper.dev.deploy | ||
|
||
import camundala.helper.util.{DeployConfig, Helpers} | ||
import os.proc | ||
|
||
import java.util.Date | ||
|
||
case class DeployHelper(deployConfig: DeployConfig) extends Helpers: | ||
|
||
val collectionId = deployConfig.postmanCollectionId | ||
val envId = deployConfig.postmanLocalDevEnvId | ||
val postmanApiKey = sys.env(deployConfig.postmanEnvApiKey) | ||
|
||
def deploy(integrationTest: Option[String] = None): Unit = | ||
println(s"Publishing Project locally") | ||
val time = new Date().getTime | ||
|
||
os.proc("sbt", "publishLocal").callOnConsole() | ||
|
||
os.proc( | ||
"newman", | ||
"run", | ||
s"https://api.getpostman.com/collections/$collectionId?apikey=$postmanApiKey", | ||
"-e", | ||
s"https://api.getpostman.com/environments/$envId?apikey=$postmanApiKey", | ||
"--folder", | ||
"deploy_manifest", | ||
"--global-var", | ||
s"developer=${System.getProperty("user.name").toUpperCase}" | ||
).callOnConsole() | ||
|
||
integrationTest.map { test => | ||
val testName = if test == "all" then "" else test | ||
os.proc("sbt", "-J-Xmx3G", s"simulation/testOnly *$testName").callOnConsole() | ||
} | ||
|
||
println(s"Deploy and test finished in ${(new Date().getTime - time) / 1000} s") | ||
end deploy | ||
end DeployHelper |
7 changes: 7 additions & 0 deletions
7
04-helper/src/main/scala/camundala/helper/util/DeployConfig.scala
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,7 @@ | ||
package camundala.helper.util | ||
|
||
case class DeployConfig( | ||
postmanCollectionId: String, | ||
postmanLocalDevEnvId: String, | ||
postmanEnvApiKey: String = "POSTMAN_API_KEY" | ||
) |