flux-eco/source-downloader

由 fluxlabs 开发的 flux-capacitor 应用组件

1.1.1 2022-04-03 04:36 UTC

This package is auto-updated.

Last update: 2024-09-30 01:41:07 UTC


README

此组件支持软件源代码的下载,例如用于构建 Docker 容器

用法

sourceList.yaml

- sourceType: tar-gz
  directoryPath: /var/www
  directoryName: ilias
  url: https://github.com/ILIAS-eLearning/ILIAS/releases/download/v7.7/ILIAS-7.7.tar.gz
- sourceType: git
  url: https://github.com/fluxapps/SrContainerObjectMenu.git
  directoryPath: /var/www/ilias/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook
  directoryName: SrContainerObjectMenu
  tag: v2.5.7

.env

SOURCE_DOWNLOADER_SOURCE_LIST_FILE_PATH=sourceList.yaml
SOURCE_DOWNLOADER_VOLUME_PATH=/tmp
SOURCE_DOWNLOADER_GIT_FULL_CLONE=0

面向对象的使用

<?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);

函数式使用

<?php

require_once __DIR__ . '/../vendor/autoload.php';

fluxy\loadDotEnv(__DIR__);

fluxy\downloadSources(
    fluxy\getEnvSourceDownloaderSourceListFilePath(),
    fluxy\getEnvSourceDownloaderVolumePath(),
    fluxy\getEnvSourceDownloaderGitFullClone()
);

贡献 💜

请 ...

  1. ... 在 https://git.fluxlabs.ch 注册账户
  2. ... 创建拉取请求 🔥

调整建议 / 错误报告 🐾

请 ...

  1. ... 在 https://git.fluxlabs.ch 注册账户
  2. ... 向我们请求服务水平协议: support@fluxlabs.ch 😘
  3. ... 阅读并创建问题