-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1-1-0 See merge request fluxlabs/flux-eco/source-downloader!10
- Loading branch information
Showing
19 changed files
with
189 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SOURCE_DOWNLOADER_SOURCE_LIST_FILE_PATH=sourceList.yaml | ||
SOURCE_DOWNLOADER_VOLUME_PATH=/tmp | ||
SOURCE_DOWNLOADER_GIT_FULL_CLONE=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use FluxEco\SourceDownloader; | ||
use FluxEco\DotEnv; | ||
|
||
DotEnv\Api::new()->load(__DIR__); | ||
|
||
$sourceListFile = getenv(SourceDownloader\Env::SOURCE_LIST_FILE_PATH); | ||
$volumePath = getenv(SourceDownloader\Env::VOLUME_PATH); | ||
$gitGetFullClone = getenv(SourceDownloader\Env::GIT_FULL_CLONE); | ||
|
||
$api = SourceDownloader\Api::new($gitGetFullClone); | ||
$api->downloadSources($sourceListFile, $volumePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
fluxy\loadDotEnv(__DIR__); | ||
|
||
fluxy\downloadSources( | ||
fluxy\getEnvSourceDownloaderSourceListFilePath(), | ||
fluxy\getEnvSourceDownloaderVolumePath(), | ||
fluxy\getEnvSourceDownloaderGitFullClone() | ||
); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace fluxy; | ||
|
||
use FluxEco\SourceDownloader\Api; | ||
|
||
function downloadSources(string $sourceListFile = null, ?string $volumePath = null, bool $gitGetFullClone = true) | ||
{ | ||
$api = Api::new($gitGetFullClone); | ||
$api->downloadSources($sourceListFile, $volumePath); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace fluxy; | ||
|
||
use FluxEco\SourceDownloader; | ||
|
||
function getEnvSourceDownloaderGitFullClone() : bool | ||
{ | ||
return (bool) getenv(SourceDownloader\Env::GIT_FULL_CLONE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace fluxy; | ||
|
||
use FluxEco\SourceDownloader; | ||
|
||
function getEnvSourceDownloaderSourceListFilePath() | ||
{ | ||
return getenv(SourceDownloader\Env::SOURCE_LIST_FILE_PATH); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace fluxy; | ||
|
||
use FluxEco\SourceDownloader; | ||
|
||
function getEnvSourceDownloaderVolumePath(): string | ||
{ | ||
return getenv(SourceDownloader\Env::VOLUME_PATH); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace FluxEco\SourceDownloader; | ||
|
||
use FluxEco\SourceDownloader\{Adapters, Core\Ports}; | ||
|
||
class Api | ||
{ | ||
private Ports\Service $service; | ||
|
||
private function __construct(Ports\Service $service) | ||
{ | ||
$this->service = $service; | ||
} | ||
|
||
public static function new(bool $gitGetFullClone = true) : self | ||
{ | ||
$apiGatewayService = Ports\Service::new(Adapters\Configs\Outbounds::new($gitGetFullClone)); | ||
return new self($apiGatewayService); | ||
} | ||
|
||
public function downloadSources(string $sourceListFile = null, ?string $volumePath = null) { | ||
$this->service->downloadSources($sourceListFile, $volumePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.