Skip to content
Snippets Groups Projects
Commit 7f0aff66 authored by Dominic Kim's avatar Dominic Kim Committed by rodric rabbah
Browse files

Make OW run with docker for mac (#1790)

* Add documentation for docker for mac (#1431)
* Replace akka-http client to play-ws client (temporarily)
* Introduce docker-machine environment
parent 9d37b3f9
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ node_modules
.idea
# Ansible
ansible/environments/mac/hosts
ansible/environments/docker-machine/hosts
ansible/db_local.ini*
ansible/tmp/*
ansible/roles/nginx/files/*.csr
......
......@@ -7,6 +7,8 @@ repositories {
}
tasks.withType(Test) {
systemProperties(System.getProperties())
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true
......@@ -50,6 +52,7 @@ dependencies {
compile 'com.typesafe.akka:akka-testkit_2.11:2.4.16'
compile 'com.google.code.gson:gson:2.3.1'
compile 'org.scalamock:scalamock-scalatest-support_2.11:3.4.2'
compile 'com.typesafe.play:play-ws_2.11:2.5.11'
compile project(':common:scala')
compile project(':core:controller')
......
......@@ -161,12 +161,10 @@ object ActionContainer {
private def syncPost(host: String, port: Int, endPoint: String, content: JsValue)(
implicit actorSystem: ActorSystem): (Int, Option[JsObject]) = {
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.marshalling._
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling._
import akka.stream.ActorMaterializer
import whisk.core.container.AkkaHttpUtils
import common.AkkaHttpUtils
implicit val materializer = ActorMaterializer()
......@@ -176,10 +174,8 @@ object ActionContainer {
path = Uri.Path(endPoint))
val f = for (
entity <- Marshal(content).to[MessageEntity];
request = HttpRequest(method = HttpMethods.POST, uri = uri, entity = entity);
response <- AkkaHttpUtils.singleRequest(request, 90.seconds, retryOnTCPErrors = true);
responseBody <- Unmarshal(response.entity).to[String]
response <- AkkaHttpUtils.singleRequest(uri.toString(), content, 90.seconds, retryOnTCPErrors = true);
responseBody <- Unmarshal(response.body).to[String]
) yield (response.status.intValue, Try(responseBody.parseJson.asJsObject).toOption)
Await.result(f, 90.seconds)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment