What I'm trying to accomplish:
Merge code to Github
Jenkins sees the merge and builds the project
Deploy the project to IIS
Navigate to website and see the updated changes.
Sorry if this has already been asked but I have searched all day for a up-to-date tutorial on how to implement continuous integration and delivery with Github, Jenkins, ASP.NET MVC5, and IIS server.
I am pretty new to CI/CD. Could one of you point me to a tutorial that works? I want to learn how to do this so if you have any links to good documentation on the matter, that would be great.
Details:
I am using code first migrations with entity framework 6.
SQL database, Jenkins, and IIS are all on the same server.
Any help would be greatly appreciated
You can install github plugin to jenkins server. Set your server, credentials, project and hook settings(because of need to deploy when commited)
Create your deployment pipeline. You have your project source.
Install msbuild to server and prepare your deployment files.
Now you have deployment files, Use PsExec to stop app pool and web-site. https://gist.github.com/sdesalas/6533286
Use Robocopy to copy your files to server.
Use PsExec to start app pool and web-site.
Thats all. I hope this helps.
Related
I am sorry to ask a question which doesn't have a specific problem, but I would be more than grateful if you could point the problem. (I can always provide other parts of my code which would be relevant to my question)
I am using Visual Studio to create my web application with ASP.NET MVC Core. All is good with the project and I can make it work on my localhost.
I bought a third party hosting service with Windows hosting (Plesk) and as far as I've asked them, they said their hosting plan supports ASP.NET Core.
For the deployment part, I've literally searched each and every source and tried various different methods but could not properly upload my files on ftp. Trying ASP.NET Core 1.0.0 version worked well and I uploaded a sample website, but since I am working with ASP.NET Core 1.1.0 now, I am unable to find a solution.
Here is what my publish profile looks like before hitting publish button:
I'm not really sure if I filled all the information correctly, but validation seems to work well.
And here is the log which I get after trying the publish via ftp method in visual studio:
Even though it seems to succeed, when I look at my ftp directory after this process, the files in visual studio project were never uploaded in the directory.
Any help is appreciated, thanks.
I have deploy the same on my server and it is working fine see the attached screenshot.
I am completely new to Azure and PowerShell but have been tasked with setting up a build and deploy solution for several app services.
We currently have a build server (Azure VM) that is running CruiseControl.NET to build and test some C# .NET solutions that should be deployed in Azure.
This build server currently handles the following tasks:
Pulling code from source control when commits happen
Building the projects
Running some unit test cases
Copying output/binaries to an output location
However, as it exists now, developers of each of our app services need to 'Publish' their services manually from their development machines by clicking the button in Visual Studio once they have verified that the build and test cases have passed in the test environment on the server.
As I am hoping for a completely automated solution, I expect I need to use something like PowerShell or the Azure Cross Platform CLI (npm) to do this?
I'm extremely confused with the Azure Service Management vs Azure Resource Management versions with the new Azure Powershell 1.0. All of our services appear to be the newer Resource Management versions, not 'classic'.
The eventual goal is to have the build server do the following
Pulling code from source control when commits happen
Building the projects
Running some unit test cases
Copying output/binaries to an output location
If the build and test cases are successful, update the service in azure to the latest build
I am hoping there is a way to set up these projects, or take the existing binaries that result from the builds, and have them be deployed into Web Apps using the new Azure Resource Management Powershell features.
Any advice or resources for more information about how this can be done?
Hopefully this makes some sense. Please let me know if I am going about this completely the wrong way or direct me to a more correct forum.
Thanks!
have you consider to use Azure App Service? where you can get those build infrastructure for free. e.g https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
Once you setup continues deployment, you will get below three when there is push event (if you are using git)
Pulling code from source control when commits happen
Building the projects
Copying output/binaries to an output location
and to "Running some unit test cases", you can create your own batch or powershell script with post deployment hook https://github.com/projectkudu/kudu/wiki/Post-Deployment-Action-Hooks
The school has given us an ubuntu server to use for an svn repository, trac, and building automated processes. The people in my group are all using visual stuido to develop the project.
Right now the server is setup to use ant as the builder and auto reports junit and javadocs to the apache webserver for easy viewing on the web.
My question is, how do I setup the server to do the same thing but for a c# project.
What I have done is install mono on the server. Now I am looking into nant to replace ant on the server but I am struggling to come up with a script to run with the post-commit hook.
From my understanding, we will develop in visual studio and commit through svn and then nant will execute when post-commit hook is called by the svn server.
I also found nunit to replace junit for testing purposes.
Sorry for the random thoughts but basically I am looking for advice/suggestions on how the setup the server for the project. am I headed in the right direction?
Run NAnt through mono or run XBuild (similar to MSBuild). post-commit hooks are ok for very light things, but look at Jenkins or TeamCity or travis-ci.org or AppVeyor or AppHarbor for anything major. Even better, git publish to Azure Web Apps with a free DreamSpark account, and it'll build and deploy on a post-commit hook.
We have a solution which consists of several projects. Some of the projects are windows tasks, some are windows services and some are mvc-websites which are running on a remote server. On this server we are currently implementing TeamCity as CI server for automating our builds and deployments. As of now, the projects are deployed on this same server. The build, test steps etc works fine but I am not sure how to deploy the tasks and services. All tutorials about this subject (at least those I have seen) only concerns deployment of websites.
The most obvious way is to have a post-build step running a powershell script which are uninstalling the current running windows service, removes the old service, copy the new dll and start the service again. The windows task files could simply be replaced directly with the new version.
However, I do not like this solution, it feels very blunt and could perhaps be hard to implement if the deployment server is remote.
Does anyone have any better suggestion on how to make the deployment?
Have a nice day!
Try to look at Octopus depoy: http://octopusdeploy.com/. You can easy integrate it with TeamCity. It has abillity to star/stop service and much more. Moreover it use nuget packages.
You can deploy windows services via Web Deployment Tool as well. All you have to do is to create manifest.xml file with runCommand (un/install and start/stop service) and dirPath (deploy service) providers.
My manifest file which deploys also DB and web site looks like:
<sitemanifest>
<dbDacFx path='$dbSource' />
<runCommand path='$presync' waitInterval='30000'/>
<dirPath path='$winSource' />
<runCommand path='$postsync' waitInterval='30000'/>
<IisApp path='$webSource' managedRuntimeVersion='v4.0'/>
<setAcl path='$webSource' setAclResourceType='Directory'/>
<setAcl path='$webSource' setAclResourceType='Directory' setAclUser='anonymousAuthenticationUser'/>
</sitemanifest>
It's generated by build script in Psake, but you can do it as you wish.
I wrote two blogs about this topic, but they are in czech language.
Everything in one package
Parametrization of package
Hope, there is something that can help you.
Inedo's BuildMaster can pick up right where TeamCity leaves off using the BuildMaster TeamCity Extension. There's a free version avaiable that will probably solve your requirements.
We have to solve this own problem when we use BuildMaster to build/deploy BuildMaster (before installers get built), and if you take a look at the BuildMaster Specifics (Inedo.com > Support > Specifics > BuildMaster, you can see precicely how we stop/deploy/start the Windows service.
I am using visual studio web project to install my web application and do some customization like modifying connection string in web.config file during install time.
Now, My requirement is to create a patch for the web application so that next time the web installer only the changed files.
Is there is any one to do it using visualk studio 2010 ide or any other way.We can't use third party products like Installshield,wix,innosetup etc.
Please suggest.
Visual Studio doesn't support patches for setup projects. It supports only major upgrades.
If you really don't want to use other setup authoring tools, you can try creating the patch manually. You can read more about this here:
http://msdn.microsoft.com/en-us/library/aa370578(VS.85).aspx
But it won't be easy.
If it is just Web project, I would recommend re-deploy instead of patching. Meaning you just deploy new version of site, above the previous one.
Except some really comprehensive case that strategy works all the time. I use simple xcopy deploy for all my projects.
You can write a mini C# app to do it. You can have the list of assembly files in a configuration. On loading of the app, it checks the timestamp difference between server and client files. On finding the change, the mini app pushes the changes file.
Hope, it will resolve your issue
There may be better suited solutins to deply websites than using an installer. For one, there's Web Deploy.
It's main purpose is deploying web applications to IIS and it allows you to modify key configuration values through a simple UI.
Web Deploy works with deployment packages; a big zip containing your application and some meta data to help install it. On deployment it will diff the deployed site with the data in the deployment package to update existing files, add new ones and remove obsolete files.
You can build deployment packages directly from Visual Studio and/or from MSBuild, using your favorite build server.
Web Deploy works really well when you need to deploy often or when you have to delegate deployment to IT staff.
Customizing Web Deployment package is a bit tedious though, you may find a blog post I wrote about this useful.
For simpler situations, I recommend good version control practices and xcopy deployment.
If you tag what you deploy to your server, you can zip up the changed files since last deployment and copy those to your server.