简体   繁体   中英

MSBuild and Jenkins: where to put credentials?

I am trying to set up a small continuous integration server using Jenkins, Git and MSBuild.
I have read so many different tutorials on this topic but I still have so many questions!

I created a Jenkins job which will pull changes from Git and deploy to another server with MSBuild.

The build action is calling MSBuild.exe and takes the following properties:

/p:VisualStudioVersion=12.0
/p:Configuration=Release
/p:Platform="Any CPU"
/p:DeployOnBuild=True
/p:DeployTarget=Test
/p:MsDeployServiceUrl=https://myserver:8172/MsDeploy.axd
/p:AllowUntrustedCertificate=True
/p:UserName=myusername
/p:Password=mypassword

It is working happily, but I would like to know more. For example:

  1. I am specifying the credentials as properties. Is there a better way to go? Please note that the deployment server is external (not in LAN)
  2. Do I need to use the /P:CreatePackageOnPublish=True property? If yes, why?

Until now I have tried to follow the following tutorials:

  1. I would recommend not building a .sln or .csproj file directly. But write a mini-msbuild-definition file (usually .proj) and put some parameters in there. (And keep your command line call simpler)

  2. Then your question changes slightly to "how do I store credentials". I usually store them in a standalone file.

This url shows how to protect the "sensitive info" file.

Encrypting password in a MSBuild file

I like to store my info in a small xml file, as seen here:

FTP Credentials for MSBuild.ExtensionPack.Communication.Ftp

Here is an example of a "basic msbuild (.proj)" file. (Below link)

This is for CC.NET. But the philosophy is the same. Do very little hudson/jenkins/cc.net/other propietrary calls. Use a .proj file for 99% of what you need to do. and think of your CI (jenkins/cc.net/other) as a "super fancy msbuild executor"

How to setup building steps for CruiseControl.net from repository of the building project?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM