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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM node:8.15.0
COPY /src /opt/executor
WORKDIR /opt/executor
RUN if [ ! -d "sdk-node" ]; then git clone --depth 1 https://github.com/ProcessMaker/sdk-node.git; fi
RUN cd /opt/executor/sdk-node; npm install
RUN cd /opt/executor/sdk-node; npm run-script build
RUN npm install
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ A docker image that allows executing native ES6 in [ProcessMaker 4](https://gith
### Building

To build from the master branch of the SDK at https://github.com/ProcessMaker/sdk-node.
This will build the image as processmaker/docker-executor-node:dev-master
This will build the image as processmaker4/executor-node:latest

`./build.sh`
`docker build -t processmaker4/executor-node:latest .`

You can specify a branch from the SDK repo with the BRANCH env var.
This will use that branch and build the as processmaker/docker-executor-node:feature-123

`BRANCH=feature/123 ./build.sh`

You can specify a tag.
This will build the image from the master SDK branch as processmaker/docker-executor-node:test-123

`TAG=test-123 ./build.sh`
If you want to use a different branch or local build of the sdk, you can copy it to `./src/sdk-node`
and it will be used instead of cloning from github.

### Scripts
The javascript must return either an object, a promise that resolves to an object, or nothing.
Expand Down
16 changes: 0 additions & 16 deletions build.sh

This file was deleted.

3 changes: 2 additions & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Promise.all([getConfig, getData]).then(function(values) {
// Nothing to output
return writeScriptOutput('');
} else if (typeof result === 'object') {
result = Object.assign({}, data, result)
return writeScriptOutput(JSON.stringify(result));
} else {
console.log(
Expand All @@ -51,5 +50,7 @@ Promise.all([getConfig, getData]).then(function(values) {
"Got a " + typeof result)
return
}
}).catch((error) => {
console.error(error);
})
})
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "bootstrap.js",
"dependencies": {
"process_maker_api": "file:./sdk-node"
"process_maker_api": "./sdk-node"
},
"devDependencies": {},
"scripts": {
Expand Down