Skip to content

Commit 520f144

Browse files
committed
Allow for docker customization
1 parent e8a6dcb commit 520f144

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ RUN apt-get update && apt-get install -y git-core
88

99
COPY /src /opt/executor
1010
WORKDIR /opt/executor
11-
RUN if [ ! -d "sdk-java" ]; then git clone --depth 1 https://github.com/ProcessMaker/sdk-java.git; fi
12-
WORKDIR /opt/executor/sdk-java
13-
RUN mvn clean install
14-
WORKDIR /opt/executor

src/DockerExecutorJavaServiceProvider.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,33 @@ public function register()
2828
public function boot()
2929
{
3030
\Artisan::command('docker-executor-java:install', function () {
31-
// nothing to do here
31+
// Copy the default custom dockerfile to the storage folder
32+
copy(
33+
__DIR__ . '/../storage/docker-build-config/Dockerfile-java',
34+
storage_path("docker-build-config/Dockerfile-java")
35+
);
36+
37+
// Restart the workers so they know about the new supported language
38+
\Artisan::call('horizon:terminate');
39+
40+
// Build the base image that `executor-instance-php` inherits from
41+
system("docker build -t processmaker4/executor-java:latest " . __DIR__ . '/..');
42+
43+
// Build the instance image. This is the same as if you were to build it from the admin UI
44+
\Artisan::call('processmaker:build-script-executor java');
3245
});
3346

3447
$config = [
3548
'name' => 'Java',
3649
'runner' => 'JavaRunner',
3750
'mime_type' => 'application/java',
38-
'image' => env('SCRIPTS_JAVA_IMAGE', 'processmaker4/executor-java'),
51+
'image' => env('SCRIPTS_JAVA_IMAGE', 'processmaker4/executor-instance-java:v1.0.0'),
3952
'options' => [
4053
'invokerPackage' => "ProcessMaker_Client",
4154
'modelPackage' => "ProcessMaker_Model",
4255
'apiPackage' => "ProcessMaker_Api",
43-
]
56+
],
57+
'init_dockerfile' => "FROM processmaker4/executor-java:latest\nARG SDK_DIR\n",
4458
];
4559
config(['script-runners.java' => $config]);
4660

src/ProcessMaker.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class ProcessMaker {
1111
public static ApiClient api() {
1212
String baseApiUrl = System.getenv("API_HOST");
1313
String v3Token = System.getenv("API_TOKEN");
14+
String verifySsl = System.getenv("API_SSL_VERIFY");
1415
int connectTimeout = 60000;
1516
int readTimeout = 120000;
1617

@@ -22,6 +23,11 @@ public static ApiClient api() {
2223
}
2324
client.setConnectTimeout(connectTimeout);
2425
client.setDebugging(false);
26+
27+
if (verifySsl.equals("0")) {
28+
client.setVerifyingSsl(false);
29+
}
30+
2531
return client;
2632
}
2733

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Install the processmaker4 SDK
2+
COPY $SDK_DIR /opt/executor/sdk-java
3+
WORKDIR /opt/executor/sdk-java
4+
RUN mvn clean install
5+
WORKDIR /opt/executor

0 commit comments

Comments
 (0)