Tago.GitCloner.Tool 6.0.5-preview-20240701-001

This is a prerelease version of Tago.GitCloner.Tool.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global Tago.GitCloner.Tool --version 6.0.5-preview-20240701-001                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Tago.GitCloner.Tool --version 6.0.5-preview-20240701-001                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Tago.GitCloner.Tool&version=6.0.5-preview-20240701-001&prerelease                
nuke :add-package Tago.GitCloner.Tool --version 6.0.5-preview-20240701-001                

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:
{
  "Tags":[
    "tago",
    "pre-release"
  ],
  "DisplayName": "Tago Template",
  "Description": "",
  "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}"
    },
    {
      "From": "@@AUTO_GENERATED",
      "To": "{SLN_PROJECT_NAME}"
    }
  ],
  "Options": [
    {
      "Name": "WeatherForecast2",
      "DisplayName": "Do you want to add WeatherForecast2? Y/N",
      "UiDisplayName": "WeatherForecast2",
      "Description": "WeatherForecast2 controller will add alternate forcasts",
      "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": "RunFile",
      "UiDisplayName": "Run a File",
      "DisplayName": "Do you want run a file? Y/N",
      "Dependencies": [
        "WeatherForecast2"
      ],
      "Actions": {
        "No": {
          "Remove": {
            "Directories": [
              "/utils"
            ],           
            "Lines": [
              {
              }
            ]
          }
        },
        "Yes": {
          "Remove": {
            "Directories": [
              "/utils"
            ]
          },
          "FileExecute": [
            {
              "Path": "/utils/Console.exe",              
              "Parameters": {
                "param1": "param value",
                "param2": "{OUTPUT_DIR}/src/123",
              }
            }
          ]
        }
      }
    },
    {
      "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 net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.