Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit ed8e290

Browse files
author
Sven Speckmaier
committed
plugin_path file to be overriden in container
1 parent c893e97 commit ed8e290

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ RUN cd /opt/rancherize-package \
4747
&& COMPOSER_ALLOW_SUPERUSER=1 ./composer.phar install \
4848
&& rm composer.phar
4949

50+
COPY docker/plugin_path.php /opt/rancherize-package
51+
5052
ENTRYPOINT ["/bin/sh", "/opt/rancherize/docker-entrypoint.sh"]

app/Plugin/Composer/ComposerPacketPathMaker.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public function makePath(ComposerPacket $packet) {
1515
$namespace = $packet->getNamespace();
1616
$name = $packet->getName();
1717

18-
return "vendor/$namespace/$name";
18+
$basePath = container( 'plugin_path' );
19+
20+
return "$basePath/vendor/$namespace/$name";
1921
}
2022

2123
}

app/Plugin/Installer/ComposerPluginInstaller.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function __construct(ComposerPacketNameParser $nameParser, ComposerPacket
3939
* @param $name
4040
* @param InputInterface $input
4141
* @param OutputInterface $output
42-
* @return mixed
4342
*/
4443
public function install($name, InputInterface $input, OutputInterface $output) {
4544

@@ -63,7 +62,7 @@ public function getClasspath($name) {
6362

6463
$composerPacket = $this->nameParser->parse($name);
6564
$path = $this->pathMaker->makePath($composerPacket);
66-
$composerJson = getcwd().'/'.$path.'/composer.json';
65+
$composerJson = $path . '/composer.json';
6766

6867
$composerContent = file_get_contents( $composerJson );
6968
$composerData = json_decode( $composerContent, true );

app/bootstrap.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111

1212
require __DIR__.'/container.php';
1313

14+
require_once __DIR__ . '/../plugin_path.php';

docker/plugin_path.php

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$container = container();
3+
4+
$container['plugin_path'] = '/opt/rancherize';

plugin_path.php

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$container = container();
3+
4+
$container['plugin_path'] = getcwd();

0 commit comments

Comments
 (0)