Skip to content
Merged
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
5 changes: 4 additions & 1 deletion ci/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ const LANGUAGE_VERSIONS = {
javascript: ['10.x', '10.x/babel']
}

const GRAPH_API = process.env.GRAPH_API || "http://localhost:3040/graphql";
const BUILDER_PORT = process.env.BUILDER_PORT || 3040;

const GRAPH_API = process.env.GRAPH_API || `http://localhost:${BUILDER_PORT}/graphql`;

const RUN_URL = process.env.RUN_URL || "https://relayer-staging.chainshot.com/run/";

module.exports = {
LANGUAGE_VERSIONS,
EXECUTION_RESULTS,
BUILDER_PORT,
GRAPH_API,
RUN_URL,
}
10 changes: 7 additions & 3 deletions ci/startServer.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
const childProcess = require("child_process");
const path = require("path");
const { BUILDER_PORT } = require('./config');
const serverPath = path.join(__dirname, "..", "server");

function startServer() {
return new Promise((resolve, reject) => {
const npmChild = childProcess.exec("npm i", { cwd: serverPath });
npmChild.on("exit", () => {
const child = childProcess.fork('src/index', [], {
CONTENT_PATH: process.env.contentPath,
CONTENT_REPO_NAME: process.env.contentRepoName,
cwd: serverPath,
detached: true,
silent: false,
env: { QUERY_ONLY: true }
env: {
CONTENT_PATH: process.env.CONTENT_PATH,
CONTENT_REPO_NAME: process.env.CONTENT_REPO_NAME,
QUERY_ONLY: true,
PORT: BUILDER_PORT
}
});
child.on('message', (msg) => {
if(msg === "started") {
Expand Down