Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Windows and Linux Support[GCI] #24

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/HighLevelDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/services/azure-api-app-service/azure-api-app-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ if (process.argv[2] == "api-start") {
initFile = process.argv[4];
}

if (navigator.appVersion.indexOf("Linux") != -1)
{
let docker = new Docker({
socketPath: "/var/run/docker.sock"
});
} else if (navigator.appVersion.indexOf("Win") != -1) {
let docker = new Docker({
socketPath: "//./pipe/docker_engine"
});
}

class AzureApiAppService extends CloudLocal {
init() {
this.port = 9567;
Expand Down
15 changes: 15 additions & 0 deletions src/services/azure-cosmosdb/tests/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import test from 'ava';
import http from 'ava-http';

test('foo should succeed', t => {
const res = await http.get('http://localhost/');
t.true(typeof res === 'object'); // json object by default
t.deepEqual(res, {expected: 'output'}); // deepEqual comparison
});

test('bar should error', t => {
http.post('http://localhost/').catch(err => {
t.is(err.statusCode, 400);
t.deepEqual(err.response.body, {error: 'message'});
});
});
13 changes: 6 additions & 7 deletions src/services/azure-functions/azure-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ const stream = require("stream");
const chalk = require("chalk");
const tar = require("tar-fs");

let docker;
if(process.platform != 'win32'){
docker = new Docker({
if (navigator.appVersion.indexOf("Linux") != -1) {
let docker = new Docker({
socketPath: "/var/run/docker.sock"
});
} else {
docker = new Docker({
} else if (navigator.appVersion.indexOf("Win") != -1) {
let docker = new Docker({
socketPath: "//./pipe/docker_engine"
})
}
});
}

let workingDir = "./example/azure-functions/";
let folder;
Expand Down
13 changes: 6 additions & 7 deletions src/services/azure-storage/azure-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
const CloudLocal = require("./../azure/cloud-local");
const Docker = require("dockerode");

let docker;
if(process.platform != 'win32'){
docker = new Docker({
if (navigator.appVersion.indexOf("Linux") != -1) {
let docker = new Docker({
socketPath: "/var/run/docker.sock"
});
} else {
docker = new Docker({
} else if (navigator.appVersion.indexOf("Win") != -1) {
let docker = new Docker({
socketPath: "//./pipe/docker_engine"
})
}
});
}

// let commandHandlers = {"storage": {"clear": clearFiles, "stop": removeContainer }}
let commandHandlers = {
Expand Down