Deploy package to multiple IIS sites on same tentacle - teamcity

I am using Octopus Deploy and TeamCity to automate the testing, building, packing, and deployment of a .NET app to multiple servers. Most of the servers have one instance of the app, but a few of them have multiple instances.
I cannot figure out the best way to do this, or even if it is reasonably possible in Octopus.
Can anyone provide a method to do this? I know I could technically script the entire process in powershell, but it would be nice if I could take advantage of the IIS features of Octopus Deploy.

You could set up multiple steps to deploy the same nuget package.
The first one would be the IIS settings common to all servers.
Each additional one could target a specific tag (instance1, instance2, etc) and have the custom IIS settings for those instances. Just tag the machines that have the multiple instances appropriately and those extra steps will only run for those machines.

Related

How can create script to get code, publish and run it in some empty machine (NetCore WebApi)

I have a doubt.
How can i create scritps to :
Get my code from repository (GitHub, GitLab...)
Build
Publish
Test
Run in IIS
This script should run in windows or linux OS, and consider that i have a empty VM.
This application is an .Net Core WebApi.
I searched in web but not found an template geting code from repository.
This is doable with scripts like #Scott said and you should consider using solutions for this because there are some great free ones out there like teamcity with octopus integration. Here is what you need to consider if you decide on making scripts for this.
The vm you have is empty so the runtimes need to be installed and
checked are they compatible with code you are trying to deploy to
them.
The scripts for some parts of deployment will need to be run under user with sufficient privileges
You will need to handle the webserver configuration with the scripts as well for all of this
And those only a few things that are on the list for that path. Now having said that there is the path of containers which handle most of this through code and can be deployed to all of environments you mentioned before and you only need to worry that there is a container service on those vm-s you want to deploy to and it will be much easier to handle since like i mentioned it is all in code and is easily changed unlike some scripts.

Deploying node js using octopus

I am completely new to octopus. Basically i want to deploy a node application to an EC2 instance. I am using bitbucket for my sources and bamboo for CI. I wanted to know how exactly to proceed further. Or if i want to deploy my node application using octopus, should i package my node application in specific way? Or is there any tool which is actually feasible than octopus. As octopus is known for .net platform deployment. I am using mac. Do we have octopus server installer for mac?So that i can play around with it locally. Thanks in advance
Octopus needs a Windows machine to run the Server component. You can deploy to a target over SSH - so your EC2 machine doesn't need to be running Windows.
There's a guide to deploying a node.js app with Octopus that's probably the best place to start.
The deployment process should be fairly straightforward. Most likely a Package Step followed by a bash script to spin up or restart your node application.
To create a package to send to Octopus, create a zip or tarball containing all of the files you need for your node application to run. You can use octopackjs for this. It should be appropriately named with the version number as per that documentation page.
Adding a step at the end of your Bamboo build to tell Octopus to create a Release is relatively straightforward, as is deploying releases.

Prevent deployment of service if supporting services aren't yet deployed with octopus

We have a distributed system with many services which talk to each other.
Sometimes a code change in one service will require a feature to have been deployed in another service.
We use octopus to deploy all the things which is cool but we really want to prevent services from being deployed before the things they depend on are deployed.
Is there a way we can do this with octopus deploy?
For example can I make the nuget package for one service depend on an explicit version range of another package?
If you don't want to deploy all your projects as one massive deployment with a series of steps that push your different services to different machines, then I don't think there's a built-in way to make your deployments dependent on each other's version numbers like that. (see this uservoice suggestion in Octopus asking for that very feature)
However, I do think that you could write a powershell script that ran as a pre-deployment step and checked the version number of one nuget package against a version range stored in another. Then the ps script could halt or allow deployment accordingly.

Setting up Team Foundation server with Continuous integration

I have been trying to Setup TFS with continuous integration on Local Network, where we have 3 developers to check in code.
Which method of deployment should i follow to achieve this
I found these option
Deploy TFS in several ways: on one server; on many servers; or in one domain or workgroup or across domains.
and are there any tutorials to follow.
If you want to setup a CI pipeline, it is not necessary to deploy your TFS on several machines. More important is to setup a build controller on a separate machine. With that you end up having the TFS on one machine and the build controller on the other. Also you should customize the build process the way you need it. This really depends on what you want to do, f.e. running multiple build process one after another.

Sharing TeamCity between two distinct teams

Our team has a full licence for the TeamCity server, as well as 7 additional agents. Another unrelated team has reached the limits of their free TeamCity licence and is eyeing our licences up.
The powers that be think it's a good idea to run both teams using the same enterprise licence, which means that we'd be hosting the TeamCity configurations on the same server, and either sharing agents or somehow assigning some agents to one team, some to another.
One concern I have is that configuring an agent to only accept certain builds is difficult - our team has hundreds of build configurations, and we create new ones all the time. To limit an agent to certain builds, you have to fully specify the whitelist. So maintaining the agents such that we have full use of some agents, and the other team has full use of theirs will be a pain. On the other hand, just using one pool of agents means now you have arguments over priority and starvation, etc.
Does anyone have any experience of this? Is it a workable solution? How do you configure agents to reserve them for a particular team? How do you configure the server so that each team only sees their own projects, build configurations and agents? Basically what we'd want is complete separation of the projects, just using the same TeamCity server and agents.
As a gut feeling it doesn't look like a good idea...
edit: As an aside, does Hudson do this better? The ivory tower architects want us to change from TeamCity to Hudson because other people are using Hudson. If I tell them this sharing TeamCity won't work, the Hudson camp will probably use it as a stick to beat us with. Joy.
Not sure what version of TeamCity you're using but the newly released TeamCity v7.0 now has a new Agent Pool feature that provides a much easier way to distribute agents. It may be of interested to you, check out the What's New section or the Agent Pools docs for more info.
I had a similar issue with our two departments starting to share the same TeamCity instance to save the expenses of additional licenses. I must admit we didn't really have any issues apart from our agents were now twice as busy.
I enabled Per-project permissions on the Global Settings page and created 2 user groups, one for 'us', and the other for 'them'. You can then configure each group's roles accordingly. If a group does not have the Project Viewer role for a project then it does not appear for them - a great way to only display necessary projects to the group; but there are plenty of other role options to use.
I have never used Hudson so can't compare unfortunately. I should really try it out but as I've always got on so well with TC I've never had a reason too.
You can make builds on run on certain agent, from the build configuration of each build in the agent requirements section, thereby limiting any build configuration to certain agents.
For example if your agent for one team is teamcity1 you can specify:
system.agent.name does not equal teamcity1
So it will never run on that agent.
That way you can at least copy build configurations and they will run on seperate agents without the fiddle agent configuration.
The other team can create a new Teamcity server, and it will have its own new set of free build configurations and agents.
We don't do this any more, but we used to split our agents into pseudo-pools so we could reserve some for compilations and others for automated tests (because automated test jobs can swamp the grid). We added a "can_run_tests" property to the test agents, and made those builds require that property as an agent condition. It worked great, and it's the sort of thing you can bake into the AMI for a set of cloud agents.
What we do now is to make the compilation and test builds require on different AMIs, which does essentially the same thing.

Resources