Dutchskull.Aspire.PolyRepo 0.3.2

dotnet add package Dutchskull.Aspire.PolyRepo --version 0.3.2
NuGet\Install-Package Dutchskull.Aspire.PolyRepo -Version 0.3.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dutchskull.Aspire.PolyRepo" Version="0.3.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dutchskull.Aspire.PolyRepo --version 0.3.2
#r "nuget: Dutchskull.Aspire.PolyRepo, 0.3.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Dutchskull.Aspire.PolyRepo as a Cake Addin
#addin nuget:?package=Dutchskull.Aspire.PolyRepo&version=0.3.2

// Install Dutchskull.Aspire.PolyRepo as a Cake Tool
#tool nuget:?package=Dutchskull.Aspire.PolyRepo&version=0.3.2

Aspire.PolyRepo

[!WARNING]
This package is still being developed and can change. If you are trying this package please share your experience and how it could improve.

Aspire.PolyRepo is a .NET Aspire package designed to simplify the process of cloning and managing Git repositories within your .NET Aspire applications. This package allows you to configure and use Git repositories seamlessly, integrating them into your cloud-native development workflow.

Features

  • Clone Git repositories directly into your .NET Aspire application.
  • Configure repository URL, name, target path, default branch, and project path.
  • Easy integration with .NET Aspire App Host.

Installation

To install the Aspire.PolyRepo package, use the .NET CLI. Run the following command in your terminal:

dotnet add package Dutchskull.Aspire.PolyRepo

Usage

To use Aspire.PolyRepo in your .NET Aspire application, follow these steps:

Add the configuration to your App Host project.

var repository = builder.AddRepository(
    "repository",
    "https://github.com/Dutchskull/Aspire-Git.git",
    c => c.WithDefaultBranch("feature/rename_and_new_api")
        .WithTargetPath("../../repos"));

var dotnetProject = builder
    .AddProjectFromRepository("dotnetProject", repository,
        "src/Dutchskull.Aspire.PolyRepo.Web/Dutchskull.Aspire.PolyRepo.Web.csproj")
    .WithReference(cache)
    .WithReference(apiService);

var reactProject = builder
    .AddNpmAppFromRepository("reactProject", repository, "src/Dutchskull.Aspire.PolyRepo.React")
    .WithReference(cache)
    .WithReference(apiService)
    .WithHttpEndpoint(3000);

var nodeProject = builder
    .AddNodeAppFromRepository("nodeProject", repository, "src/Dutchskull.Aspire.PolyRepo.Node")
    .WithReference(cache)
    .WithReference(apiService)
    .WithHttpEndpoint(54622);

Navigate to your App Host project directory in the terminal.

Run the application using the .NET CLI or Visual Studio 2022.

dotnet run

Example

Here is an example configuration for adding a Git repository to your .NET Aspire application:

var builder = DistributedApplication.CreateBuilder(args);

var repository = builder.AddRepository(
    "repository",
    "https://github.com/Dutchskull/Aspire-Git.git",
    c => c.WithDefaultBranch("feature/rename_and_new_api")
        .WithTargetPath("../../repos"));

var dotnetProject = builder
    .AddProjectFromRepository("dotnetProject", repository,
        "src/Dutchskull.Aspire.PolyRepo.Web/Dutchskull.Aspire.PolyRepo.Web.csproj")
    .WithReference(cache)
    .WithReference(apiService);

var reactProject = builder
    .AddNpmAppFromRepository("reactProject", repository, "src/Dutchskull.Aspire.PolyRepo.React")
    .WithReference(cache)
    .WithReference(apiService)
    .WithHttpEndpoint(3000);

var nodeProject = builder
    .AddNodeAppFromRepository("nodeProject", repository, "src/Dutchskull.Aspire.PolyRepo.Node")
    .WithReference(cache)
    .WithReference(apiService)
    .WithHttpEndpoint(54622);

builder.Build().Run();

This configuration clones the specified Git repository into your application, making it available for further development and deployment.

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.2 54 6/17/2024
0.3.1 55 6/17/2024
0.3.0 60 6/15/2024