Skip to content

Commit ee89472

Browse files
committed
Merge branch 'feature/1473' into feature/1472
2 parents 088184e + 05a9cec commit ee89472

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎.circleci/config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
- run:
110110
name: setup SDKs
111111
command: |
112-
rm -rf storage/api && mkdir storage/api
112+
rm -rf storage/api
113113
php artisan l5:generate
114114
php artisan bpm:sdk php
115115
php artisan bpm:sdk lua

‎ProcessMaker/BuildSdk.php‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,25 @@ public function __construct($jsonPath, $outputPath, $debug = false, $rebuild = f
2222

2323
public function run()
2424
{
25+
$this->runCmd('mkdir -p ' . $this->outputBaseDir());
2526
$this->runChecks();
2627

27-
$existing = $this->existingContainers();
28+
$existing = $this->existingContainer();
2829

29-
if (!empty($existing) && $this->rebuild) {
30-
$existing = str_replace("\n", " ", $existing);
30+
if ($this->rebuild && $existing !== "") {
3131
$this->runCmd("docker container stop $existing || echo 'Container already stopped'");
3232
$this->runCmd("docker container rm $existing");
33-
$existing = [];
3433
}
35-
36-
if (empty($existing) || $this->rebuild) {
34+
35+
if ($existing === "" || $this->rebuild) {
3736
$this->runCmd('docker pull ' . $this->image);
3837
$cid = $this->runCmd('docker run -d --name generator -e GENERATOR_HOST=http://127.0.0.1:8080 ' . $this->image);
3938
$this->docker('apk add --update curl && rm -rf /var/cache/apk/*');
4039
} else {
4140
$this->runCmd("docker start generator || echo 'Generator already started'");
4241
}
42+
43+
$this->runCmd('docker start generator || echo "Container already running"');
4344

4445
$this->waitForBoot();
4546

@@ -134,7 +135,7 @@ private function unzip($file)
134135
return "/tmp/{$folder}/{$this->lang}-client";
135136
}
136137

137-
private function existingContainers()
138+
private function existingContainer()
138139
{
139140
return $this->runCmd("docker container ls -aq --filter='name=generator'");
140141
}

0 commit comments

Comments
 (0)