Deploying node js using octopus - macos

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.

Related

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.

Pulling but not deploying nuget packages on Octopus Server

I'm packaging up some mongo scripts along with the necessary binaries to run them into a Nuget package via Teamcity. Now what I want to do with Octopus is pull that package, extract the contents and run the scripts once per deployment. I don't want or need these to be deployed to any machines as these scripts are not target machine specific. I was thinking via powershell I could
Download the package (possibly query the feed for a specific version)
Extract it
Run the scripts
Clean up
Anyone experienced a similar problem?
The solution is to install a Tentacle on the Octopus Server, assign it to all environments, give it a unique role along the lines of octopus-server, and then configure a script step to use the octopus-server role as your target. You can then write a PowerShell, C# or Bash script in that script step that will call and execute the mongo scripts that you have stored in your project. That way, it'll only run on your Octopus Server. I've done something similar to run MySQL scripts recently.
The OctopusDeploy docs provide a nice walkthrough here and an explanation of why they chose to handle it that way.

Deploy package to multiple IIS sites on same tentacle

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.

Skip deployment steps during automatic octopus deployment from TeamCity

I want to skip certain steps on a Octopus project while doing automated deployment from Teamcity. I have read through the docs on how to set this up, and got it to do the deployment.
How do I go about skipping some Octopus deployment steps while using this ? Or should I create a seperate octopus project for automated deployments that only contain the basic steps, then another project containing all the steps ?
Please any help would be appreciated.
I achieved this (or something similar) with a fake environment.
We have an environment called "live - inactive" which only contains the octopus server machine. This step queries our load balancer and promotes the deployment to one of our real live environments. Our deployment process steps are not configured to run in this fake environment. So the iis config etc is skipped
As you can see in the following documentation http://docs.octopusdeploy.com/display/OD/Deploying+releases
--skip=step name as part of
Additional command line arguments for OctopusDeploy: Create release Step in Teamcity

TeamCity and PHP

We are considering TeamCity for continuous integration but have projects in both Rails (Rake tests) and PHP (PHPUnit tests).
I'm a bit new to CI - Has anyone setup TeamCity for PHP projects? If so, is it straight-forward?
Thanks,
Chad
To get the question answered:
Just use ant build scripts, and it'll work with TeamCity.
In the high demand market of web development, using CI is very beneficial and almost a requirement (now a days).
We use TeamCity, YouTrack, Perforce and PHP Maven to build, package and deploy our web applications. The setup is as follows:
Once developed, code is commited to the Perforce repository main folder for the app
TeamCity is configured to check this folder for changes and build each time changes are found (see configuring TeamCity)
Once development has reached a point where it's ready to be deployed, we integrate the main branch with the release branch
TeamCity is configured to check the release branch for changes and deploy via FTP to the server
Cron jobs are running on the app to deploy new releases to a QA branch
Once changes and functionality is verified, the status of the QA deployment is set to "deploy"
Another Cron job is running looking for new QA releases that are ready to be deployed. Once found, it extracts the package into the live folder
In this case, our PROD and QA folders are on the same server. Alternatively, you can have multiple TeamCity build configurations that push the app to different servers (or use a teamcity to define the environment variable).
Also, when we close tickets/issues in YouTrack, we can pull the build info from TeamCity as they interact with each other.
Links:
Configuring TeamCity, Maven for PHP for Joomla continuous build:
http://www.waltercedric.com/joomla-mainmenu-247/continuous-build/1552-configuring-teamcity-maven-for-php-for-joomla-continuous-build.html
We are using TeamCity to deploy a number of PHP sites -- static, Wordpress and Drupal shortly.
We use the Deployer plugin to sftp files to the appropriate server and then a script to rsync the files to the right place and to setup apache. Works very, very well.
Here is a fresh article from JetBrains on how to setup TeamCity with PHP:
http://blog.jetbrains.com/webide/2013/01/continuous-integration-for-php-using-teamcity/

Resources