Skip to content

Commit 9fdd99a

Browse files
committed
Removed include script in factory because the option does not exist
1 parent b23655a commit 9fdd99a

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

src/Adapter/Docker/Factory.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,6 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt
5353
}
5454
}
5555

56-
if (isset($configuration['docker']['include']) && is_iterable($configuration['docker']['include'])) {
57-
foreach ($configuration['docker']['include'] as $path) {
58-
if (is_dir($path)) {
59-
$builder->withDirectory(new Packaging\Directory($path));
60-
} else {
61-
$builder->withFile(new Packaging\Asset\LocalFile($path));
62-
}
63-
}
64-
}
65-
66-
if (isset($configuration['include'])) {
67-
foreach ($configuration['include'] as $path) {
68-
if (is_dir($path)) {
69-
$builder->withDirectory(new Packaging\Directory($path));
70-
} else {
71-
$builder->withFile(new Packaging\Asset\LocalFile($path));
72-
}
73-
}
74-
}
75-
7656
if (\array_key_exists('composer', $configuration)) {
7757
if (\array_key_exists('from_local', $configuration['composer']) && true === $configuration['composer']['from_local']) {
7858
if (file_exists('composer.lock')) {

src/Adapter/Docker/Satellite.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function dependsOn(string ...$dependencies): self
5656
public function build(
5757
LoggerInterface $logger,
5858
): void {
59+
$this->sortFiles();
5960
$archive = new TarArchive($this->dockerfile, ...$this->files);
6061

6162
$iterator = function (iterable $tags) {
@@ -85,4 +86,19 @@ public function build(
8586
throw new \RuntimeException('Process exited unexpectedly.');
8687
}
8788
}
89+
90+
private function sortFiles(): void
91+
{
92+
uksort($this->files, function ($a, $b) {
93+
if (is_numeric($a) && is_numeric($b)) {
94+
return $a - $b;
95+
} elseif (is_numeric($a)) {
96+
return -1;
97+
} elseif (is_numeric($b)) {
98+
return 1;
99+
} else {
100+
return strcmp($a, $b);
101+
}
102+
});
103+
}
88104
}

0 commit comments

Comments
 (0)