Tago.GitCloner.Core 6.0.0-preview-20231024-001

This is a prerelease version of Tago.GitCloner.Core.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Tago.GitCloner.Core --version 6.0.0-preview-20231024-001                
NuGet\Install-Package Tago.GitCloner.Core -Version 6.0.0-preview-20231024-001                
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="Tago.GitCloner.Core" Version="6.0.0-preview-20231024-001" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tago.GitCloner.Core --version 6.0.0-preview-20231024-001                
#r "nuget: Tago.GitCloner.Core, 6.0.0-preview-20231024-001"                
#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 Tago.GitCloner.Core as a Cake Addin
#addin nuget:?package=Tago.GitCloner.Core&version=6.0.0-preview-20231024-001&prerelease

// Install Tago.GitCloner.Core as a Cake Tool
#tool nuget:?package=Tago.GitCloner.Core&version=6.0.0-preview-20231024-001&prerelease                

Tago Git Cloner will clone the specified template from Git repository to the provided destination folder.

Usage

Additional features and options of the Tago Git Template Cloner include:

  • git-cloner: Starts a clone process as a command line.
  • git-cloner --list: Lists all available templates in the Git repository.

Prerequisites

Before using the Tago Git Template Cloner, ensure that you have the following prerequisites:

  • Git installed on your local machine. You can download Git from https://git-scm.com/downloads.
  • Git is added to the machine PATH enviroment variable
  • Access to an your organization and a Git repository.
  • Sufficient permissions to clone git repositories.

Installation

The Tago Git Template Cloner is a command-line tool and can be installed using the following steps:

  1. Open a terminal or command prompt on your local machine.

  2. Run the following command to install the tool dotnet cli (e.g., dotnet):

   dotnet tool install -g Tago.GitCloner.Tool --prerelease	

Configuration

Global Settings

Create a git-cloner-config.json under %userprofile%\.git-cloner folder

Option Type Description
TargetGitServer enum AzureDevops, Bitbucket
CredetialType enum Default - will use with the current running user, Network or Basic
OnlyTemplatesWithOptionsFile bool only templates having template-options.json will be loaded
DefaultTargetDirectory string default output folder for clones
Sources object array list of git sources to pull templales from

Source

Option Type Description
GitServer enum AzureDevops, Bitbucket
CredetialType enum Default - will use with the current running user, Network or Basic
ApiVersion string optional: rest api version
Href string repo url
UserName string optional: domain user name
Password string optional: domain password
Global Settings Exmaple:
{
  "Console": {
    "CodePage": 65001,
	"OptionsColor": "Yellow"
  },
  "Git": {
	"MainBranchName": "main",
	"CreateBranches": [ "First", "Second","main" ],
	"CheckoutBranch": "Third"
  },
  "GitBaseUrl": "http://www.myazuerserver.com:8881/tfs/",
  "OnlyTemplatesWithOptionsFile": true,
  "DefaultTargetDirectory": "C:/TemplateClones/",
  "TargetGitServer": "AzureDevops",
  "TargetGitApiVersion": "5.0",
  "CredetialType": "Network"
  "Sources": [
    {
      "GitServer": "AzureDevops",
      "ApiVersion": "5.0",
      "Href": "http://www.myazuerserver.com:8881/tfs/TAGO_GIT/Demos",
      "UserName": "userName",
      "Password": "pwd",
      "CredetialType": "Network"
    },
    {
      "GitServer": "Bitbucket",
      "Href": "http://www.mybitbucketserver.com:7990/projects/TAGO/repos",
      "UserName": "userName",
      "Password": "pwd",
      "CredetialType": "Basic"
    }
  ]
}

Template Settings

Create a template-options.json under the root template git path

Option Type Description
Replaces object array string replacements definition
Options object array yes/no user options during clone
PostAction object action to take after success clone
Template Settings Exmaple:
{
  "Constants": {
    "PROJ_TYPE":  "Tg-MicroService",
    "ORIG_TEMPLATE_NAME":  "web-api-template"
  },
  "FolderPath": "%userprofile%/tago/{GIT_PROJECT_NAME}/{PROJ_TYPE}",
  "RepoNameFormat": "Repo-{PROJECT_NAME}",
  "ProjectNameFormat": "Repo.{PROJECT_NAME}",
  "Replaces": [    
    {
      "From": "web-api-template",
      "To": "{SLN_PROJECT_NAME}"
    },
     {
      "From": "web_api_template",
      "To": "{SLN_PROJECT_NAME}"
    }
  ],
  "Options": [
    {
      "Name": "WeatherForecast2",
      "DisplayName": "Do you want to add WeatherForecast2? Y/N",
      "Actions": {
        "No": {
          "Remove": {
            "Directories": [
            ],
            "Files": [
              "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/Controllers/WeatherForecast2Controller.cs",
              "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/Controllers/WeatherForecastController.cs"
            ],
            "Lines": [
              {
                "FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}.csproj",
                "Contains": ""
              }
            ],
            "JsonNodes":[
              {
                "FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/appsettings.json",
                "NodePath": "Logging:LogLevel:default"
              }
            ]
          }
        },
        "Yes": {
          "Remove": {
            "Files": [
              "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/Controllers/WeatherForecast2Controller.cs"
            ]
          }
        }
      }

    },
    {
      "Name": "Abort?",
      "IsTemplateOption": false,
      "Condition": {
        "AnySelected": []
      },
      "DisplayName": "No option selected, Do you want to abort? Y/N",
      "Actions": {        
        "Yes": {
          "Abort": true
        }        
      }
    },
    {
      "Name": "Post",
      "Background": true,
      "Condition": {
        "AnySelected": []
      },
      "DisplayName": "clear",
      "Actions": {
        "Yes": {
          "Remove": {
            "Directories": [
            ],
            "Files": [
              "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/Controllers/WeatherForecastController.cs",
              "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/WeatherForecast.cs"

            ],
            "Lines": [
              {
                "FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}.csproj",
                "Contains": ""
              }
            ],
            "JsonNodes":[
              {
                "FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/appsettings.json",
                "NodePath": "Logging:LogLevel:default"
              }
            ]
          }
        }        
      }

    }
  ],
  "PostAction": {
    "RunFile": [
      {
        "pattern": "*.sln"
      }
    ]
  }
}

Troubleshooting

If you encounter any issues while using the Tago Git Template Cloner, consider the following troubleshooting steps:

  • Ensure that you have provided the correct repository URL.
  • Verify that you have the necessary permissions to clone repositories in your organization.
  • Double-check your internet connectivity and ensure that the Git server services are accessible.

If problems persist, please contact our support team at support@tago-solutions.com for further assistance.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.