GithubHelp home page GithubHelp logo

darquewarrior / generator-team Goto Github PK

View Code? Open in Web Editor NEW
91.0 11.0 51.0 2.16 MB

Generates an app with CI/CD in Team Foundation Server or Team Services

License: MIT License

JavaScript 89.89% C# 1.72% CSS 0.37% Java 1.21% HTML 2.29% PowerShell 3.39% Dockerfile 0.11% ASP.NET 0.02% Pug 0.85% Mustache 0.16%

generator-team's Introduction

generator-team (Yo Team)

License npm - generator-team

Build status

Build badge

See it in action

Ignite New Zealand 2016

Capabilities

generator-team is a Yeoman generator that creates a complete CI/CD pipeline in Team Foundation Server or Visual Studio Team Services for the following languages:

  • Java using Tiles and bootstrap
  • Node using Pug and bootstrap
  • ASP.net Core using Razor and bootstrap
  • ASP.net Full Framework using Razor and bootstrap

It allows you to deploy to the following platforms:

Requirements

Install

npm install yo

npm install generator-team

Usage

Yo team is written in such a manner that it will prompt you for variables it needs if they were not passed as paramaters. Interactive usage: yo team, this wil run all the yo team functionality in interactive mode.

The team generator uses smaller generators to do the brunt work

If you want to use yo team in a more fine grained way, you can discover the underlying generators using the yo --generators command the output typically looks like

> yo --generators
Available Generators:

 team
   asp
   aspFull
   azure
   build
   docker
   feed
   git
   java
   k8s
   node
   nuget
   pipeline
   powershell
   profile
   project
   registry
   release

If you want use yo team from the commandline, you can discover the parameters that are needed to call a subgenerator by using -h e.g.: yo team:project -h

IMPORTANT: the organization name (-tfs parameter) must be the namepart of the organization as used in the url (i.e. dev.azure.com/ORGANIZATION/) not the full URL!

For example: if you only want to create a project in Azure DevOps you can call

yo team:project --applicationName $projectName --tfs $organizationName --pat $azureDevOpsPersonalAccessToken

If you want to add a pipeline to the create project, you can use

yo team:pipeline --applicationName $projectName --tfs $organizationName --pat $azureDevOpsPersonalAccessToken --type $appType --queue $agentQueue --target $deployTarget --azureSubId $azureSubscriptionId --servicePrincipalId $servicePrincipleID --servicePrincipalKey $servicePrincipalKey --azureSub $azureSubscriptionName --tenantId $azureAdTenantId

The -appType parameter describes the kind of App you want to create (it's also the name of a generator):

  • aspFull, .Net Core application
  • java, Java application
  • powershell, Powershell module
  • etc.

Another source for how to use yo team is at: DonovanBrown.com.

To test

npm test

Debug

You can debug the generator using VS Code. You need to update the launch.json. Replace any value in [] with your information. Use npm link from the root folder to load your local version.

Revision history

October 2018

0.4.10

Supports K8s

August 2018

0.4.9

Does not require Docker Host when Hosted Ubuntu Agent is selected.

Node sub generator changes

  • Wires up Application Insights
  • Switched to Yarn
  • All packages were updated
  • Home controller implements IoC to ease testing

0.4.8

Merge Pull Request from Maxime Eglem which included the following:

  • Removes usage of deprecated Buffer

0.4.7

Support for PowerShell Modules using Package Management and PowerShell Gallery. This is only supported on VSTS at this time. The build will run on hosted macOS, Linux and Windows agents. The release will run on selected agent during prompts.

0.4.6

Merge Pull Request from Joseph Van Wagner which included the following:

  • Updated VSTS .net Core task to 2.*.

Set skipindexing to true in .net builds.

April 2018

0.4.5

Updated code to find profile by name for VSTS even if the profile name does not match the VSTS account name.

Got all tests passing on macOS, Linux and Windows.

March 2018

0.4.4

Updated all the dependencies. Dropped support for TFS 2017 Update 2. Only update 3.1 is supported.

December 2017

0.4.1

Added support to read profiles from VSTeam Module. Only profiles of type Pat are supported. If you enter a profile name of type OnPremise you will still be prompted for a Pat.

Added Profile sub generator to Add, List and Delete profiles.

November 2017

0.3.8

Upgraded .NET Core to 2.0.

October 2017

0.3.7-6

Now Supports Deployment slots with App Service.

September 2017

0.3.6

Now supports Azure Container Instances. You can read how to find the public IP in my blog post Yo Team, meet Azure Container Instances.

July 2017

0.3.5

Merge Pull Request from Daniel Meixner which included the following:

  • Install specific version of .NET Core for ASP.NET Core

0.3.4

Fixed bug in Java Docker Build

0.3.3

Fixed spelling error

June 2017

0.3.1

Fixed dependencies so users do not need Mocha installed.

0.3.0

.NET Core

  • Migrated .net core to csproj and updated all references.
  • The Hosted build pool is no longer supported for the .NET Core project. The upgrade to csproj is not supported on Hosted. Use HostedVS2017, Hosted Linux or private agent.
  • Removed Code coverage from .NET Core because solution was not cross-platform. It only worked on Windows agents.

Node.js

  • Fixed issue with Node.js code coverage.

Java, Node.js & .NET Core

Release Defs

  • Updated task versions
  • The following task were not updated due to breaking changes:
  • Azure Resource Group Deployment
  • Azure App Service Deploy

General

  • Updated generator npm dependencies.

March 2017

0.2.5

Updated the Azure Resource Manager Service Endpoints to work with the Azure Portal Continuous Delivery feature. Fixed bug in Azure sub generator that asked for information not needed when using VSTS.

0.2.4

Fixed some issues with TFS after locking versions for VSTS. Some of the build templates were used for both and locking versions caused issues on TFS.

0.2.3

Added Full .NET Framework support but only for Azure App Service.

0.2.2

Locked Tasks to specific version. This will prevent auto updates from breaking builds and releases.

Changed release template for PaaS to include Web Performance Test.

Changed release to default to latest version of build for manual releases.

Changed ARM templates to add unique string after Website Name. This will help make sure final website URL is globally unique.

ASP sub generator only supports .net core 1.0 RC2. RC 3 and above switched to CSPROJ. yo Team uses hosted agents as lowest common denominator and we will update as soon as CSPROJ is supported on hosted agents.

February 2017

0.2.1

Fixed a bug in the App Service deployment after adding ACR support.

0.2.0

Has breaking changes from previous version. Removed the email parameter for Docker Registries and added support for Azure Container Registry. Now you can use Docker Hub or Azure Container Registry.

January 2017

0.1.3

Improved build names from just build id to build definition name plus build id

0.1.2

Added User-Agent Header to request so calls could be identified by VSTS Team telemetry.

0.1.0

Initial release

generator-team's People

Contributors

azureadvocatebit avatar codingwithcookie avatar danielmeixner avatar darquewarrior avatar dependabot[bot] avatar maximeeglem avatar mydevopsdemos avatar wiebew avatar wiebewnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-team's Issues

Connect to VSTS behind proxy

How can we specify the http or https proxy setting for yo team?
The npm config for proxy and https-proxy does not seem to work

yo team hangs at "Getting Agent Queues" and then exits:

image

Update project templates for .NET Core to 2.0

The current generator for ASP.NET Core projects is still pointing to 1.1 which was admittedly the latest RTM till about 3 weeks ago. The latest release of .NET 2.0 means that the build template needs to use the latest released one on VSTS (including the custom download of the latest version of NuGet.exe)

If you point me to the right direction, I'll be happy to take a stub at it and raise a PR for you

windows server 2016 generator-team

while using yo team to build a demo project.

C:\Users\tfsadmin>yo team

 _-----_     ╭──────────────────────────╮
|       |    │     Welcome to DevOps    │
|--(o)--|    │   powered by Microsoft   │

---------´ │ version 0.4.5 │ ( _´U_ ) ╰──────────────────────────╯
/A\ /
| ~ |
'..'_
´ |° ´ Y

? Enter VSTS account name
({account}.visualstudio.com)
Or full TFS URL including collection
(http://tfs:8080/tfs/DefaultCollection)
Or name of a stored Profile? http://:@139.217../DefaultCollection
? What is your TFS Personal Access Token? [hidden]
Getting Agent Queues...
? What agent queue would you like to use? Default
? What type of application do you want to create? .NET Core
? What is the name of your application? YoTeamDemoApp
? Where would you like to deploy? Azure App Service
? What is your Azure subscription name? Visual Studio Enterprise - MPN
? What is your Azure subscription ID? 1dc8df9f-9d86-4633-8cfe-
****
? What is your Azure Tenant ID? 314999a7-b7c5-4b6a-96ea-********
? What is your Service Principal ID? 988086db-5b0e-42b7-b635-********
? What is your Service Principal Key? [hidden]
? Install dependencies? No

  • Found Team project
  • Cloning repository http://:@139.217..***/DefaultCollection/_git/YoTeamDemoApp
    warning: You appear to have cloned an empty repository.
  • Found Azure Service Endpoint 'Visual Studio Enterprise - MPN'

�[?25hC:\Program Files\nodejs\node_global\node_modules\generator-team\generators\app\utility.js:668

    callback(null, obj.value[0].id);
                                 ^

TypeError: Cannot read property 'id' of undefined

at Request._callback (C:\Program Files\nodejs\node_global\node_modules\generator-team\generators\app\utility.js:668:38)
at Request.self.callback (C:\Program Files\nodejs\node_global\node_modules\generator-team\node_modules\request\request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Program Files\nodejs\node_global\node_modules\generator-team\node_modules\request\request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_global\node_modules\generator-team\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)

Automate pull request process

Hi @DarqueWarrior,

Is there a way we can automate creating the branch policies? I don't currently see a way to do that in the VSTS API. Would be an awesome feature to add to yo teams.

Thanks,
Joseph

yo team syntax error

This is my first attempt so it might be me.

NPM Version 4.1.2
yo Version 1.8.5
generator-team Version 0.1.3

When running yo team from a PowerShell window I get the following error message:

~\Source\Repos> yo team
C:\Users\Dave\AppData\Roaming\npm\node_modules\generator-team\generators\app\index.js:48
   let cmdLnInput = this;
   ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.defineProperty.get [as team:app] (C:\Users\Dave\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\store.js:40:23)
    at Store.get (C:\Users\Dave\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\store.js:64:35)
    at Environment.get (C:\Users\Dave\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\environment.js:262:16)

Errors using the commandline only to do yo team

I am using yo team two submodules embedded in a powershell (due to compliance in a large finance company we need to run yo team in an agent with higher privileges)

yo team:project --applicationName $applicationName --tfs $organizationUrl --pat $azureDevOpsPersonalAccessToken
yo team:pipeline --applicationName $applicationName --tfs $organizationUrl --pat $azureDevOpsPersonalAccessToken --type $appType --queue $agentQueue --target $deployTarget --azureSubId $azureSubscriptionId --servicePrincipalId $servicePrincipleID --servicePrincipalKey $servicePrincipalKey --azureSub $azureSubscriptionName --tenantId $azureAdTenantId

What happens is that insertion of the vsrm to the url is broken with the azure devops. I have fixed it by hardforcing that url in the two calls to the releases api.

After that issue the team:pipeline freezes up if I supply the --queue parameter. If I omit it I can enter it in the provided menu (Hosted VS2017) and it works. Passing the value as param leads to a freeze. This problem is solved by downgrading node.js to version 8.

Error upon creating CI build

Hi Donovan,

Running the yo team generator, I get as far as creating the CI Build and it errors on me:

Any ideas what went wrong with the generator?

Thanks in advance,
Mark

? Enter Team Services account name
({account}.visualstudio.com)
Or full TFS URL including collection
(http://tfs:8080/tfs/DefaultCollection)? https://markarrowsmith.visualstudio.com
? What is your TFS Personal Access Token? ****************************************************
Getting Agent Queues...
? What agent queue would you like to use? Default
? What type of application do you want to create? .NET Core
? What is the name of your application? yo-vsts-demo
? Where would you like to deploy? Azure App Service
? What is your Azure subscription name? Visual Studio Ultimate with MSDN
? What is your Azure subscription ID? *******************************************
? What is your Azure Tenant ID? *******************************************
? What is your Service Principal ID? *******************************************
? What is your Service Principal Key? ********************************************
? Install dependencies? Yes

  • Creating yo-vsts-demo Team Project
  • Cloning repository https://markarrowsmith.visualstudio.com/_git/yo-vsts-demo
    warning: invalid credential line: [0x7FFECFFB70E3] ANOMALY: use of REX.w is meaningless (default operand size is 64)
    warning: You appear to have cloned an empty repository.
  • Creating Visual Studio Ultimate with MSDN Azure Service Endpoint
  • Creating CI build definition
    undefined:3

^

SyntaxError: Unexpected token < in JSON at position 4
at Object.parse (native)
at Request._callback (C:\Users\marro\AppData\Roaming\npm\node_modules\generator-team\generators\app\utility.js:615:22)
at Request.self.callback (C:\Users\marro\AppData\Roaming\npm\node_modules\generator-team\node_modules\request\request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (C:\Users\marro\AppData\Roaming\npm\node_modules\generator-team\node_modules\request\request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (C:\Users\marro\AppData\Roaming\npm\node_modules\generator-team\node_modules\request\request.js:1091:12)
at IncomingMessage.g (events.js:286:16)

c:\Dev\yo-team-demo>

Provide more instructions for developing and testing locally

Hi @DarqueWarrior,
I love contributing to open source projects and this one is a great example of how we can make better tools for us and our users. I understand that this is a pet project that has now gained a lot of traction and interest by the community so I would like to suggest that we make it easier for people to contribute.

It would be great if we could add a Contributing.MD or expand the existing sections on the Readme.MD to explain how to download, develop and run on the local machine. This would help with people that don't have good experience working with local npm packages for example (like me...)

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.