How to run "deploy a package step" on Octopus server same as script task step - octopus-deploy

We are using octopus deploy as Continuous delivery. We have already setup all web related configuration on octopus "Deploy Package Step" where we are deploying nuget package to octopus server and then it is deploying the application to multiple server nodes.
Now we are planning to implement database automation using DBUP on octopus server.We are creating a nuget package and using "Deploy.ps1" which contains the power shell command to execute the console exe application on server.
We are using "Deploy Package step " for the same we don't want to install tentacles on DB server we want to use the same connection string which is already configured for our web application. We have just created DB user with DDL access(Create,Alter..).
As for our web environment we have multiple VM in environment so we don't want to execute the script on multiple environment.
with "Deploy Package" step on octopus we are not getting any option where we can configure to execute the package on octopus server.
Please share your thoughts on the same.

Disclaimer: I am an Octopus employee.
I'd recommend using the "Run a script" step rather than "Deploy a package" for your SQL deployment. This step allows you to run the script on the Octopus server, and the script can still be inside a package.
Feel free to also reach out to us at our usual support channels such as our support forum or email. Details at https://octopus.com/support

2 options:
As #JaydenPlatell mentioned, Run a script step and then you can select the feed and package. Though in that case your deployment script has to be part of the package itself.
Have a tentacle installed on 1 deployment machine (for example could be the same as Octopus Server). Give it a role of "DB deployer" or similar and use it for deploying. Benefit of this is that you can have one DB deploy" Script module shared for different deployment projects.

Related

Continuous Integration with VSTS

I am trying to do a PoC on how to achieve continuous integration and deployment using VSTS.
I have been successful in the build process i.e. from VSTS it will pull the code (asp.net based application) and build. The build process is also getting successful.
Now after the build is done I want to deploy the application and run my maven based selenium test cases written in java on the application. This is the part where I am struck. As in the deployment step it is not able to put the artifacts to the remote path that I am mentioning.
Can anyone please provide me some pointers on how to achieve the deployment on a remote machine and then run the java based test cases on this application?
Any pointers would be greatly appreciated.
Ok..here is the complete scenario...
1. I have the asp.net code on cloud in my vsts
2. I have been able to add a build step and create the artifacts successfully
3. Now I have a IIS server where i want to deploy these artifacts, and the server is not accessible from the public network and is behind a firewall.
Hence I am looking for any task that would help me achieve this. I am not sure of the complications that might arise due to the firewall and hence am trying out different methods to understand the complete big picture.
I received a reply here to use the Win RM tasks. I used that but it is giving a 53 error and not able to connect to the server that I am trying to deploy the code on.
To deploy asp.net based application, you can use IIS Web App Deployment step/task to deploy to your server or deploy to azure web site by using Azure App Service Deploy step/task.
To do Java test, there is a Maven step/task.

Team City to deploy artifacts to external server

I've tried taking a look on Google for how this can be done but I thought I'd post a question anyway to see what the best practice is for doing this nowadays.
We are trying to setup a Team City build to deploy to a clients environment, basically we're generating an artifacts zip file and the plan is to (somehow) deploy this to the clients UAT, Staging and Live Servers (which are password protected). When the build is run it executes a nant script.
From our network in the office we are able to remote into the UAT box, but we can only get to the Staging and Live servers whilst on the UAT box.
What is the best way of doing this? Are there any useful resources I can look at to help me move forward?
You can try Deployer Plugin developed by TeamCity team. It offers SMB/FTP/SSH deploy options as well as SSH Exec option.

Back/restore single environment in Octopus Deploy

We've been experimenting with Octopus Deploy on a development PC and now want to transfer the environment we've created onto our main Octopus Deploy server (which is used by other teams and already has a few environment set up on it).
So we would like to backup/restore this one environment. However, it looks like Octopus only allows you to backup/restore the entire database.
Is it possible to move a single environment from one Octopus server to another using backup/restore or another means?
What worked for me was simply doing the following in order:
Shutting down Octopus service so that no transaction going through.
Copy the raven database (usually stored in Program Files\Data) to your new server.
Install the new Octopus server and during the setup, in the Storage Tab, specify the location of your data location copied in the second step above.
The Octopus developer, Paul, mentions the great thing about RavenDB is the installation. It requires no services running like SQL. It's just a copy paste of the data itself and great for installation and portability.
There's currently no way to backup/restore just part of the database - you'd need to restore a full backup, and then delete the information you don't need.
Octopus 2.0 (which is now a public beta) has a comprehensive REST API so it would be possible to use that API to fetch a subset of information and import it to your new Octopus server.

How to load balance and deploy on a web farm

I am using webdeploy to automatically deploy a application on a testserver via teamcity. Now once all test scripts are run I want to deploy it on Live servers. I have installed a web farm on server1(controller) and I have 2 other servers server2(primary) and server3(secondary) as web farm agents setup. Now how can I copy the publish done on testserver to my live sites on server2 and server3 and it do the load balancing. can any one please explain how I can Accomplish this task automatically using teamcity. or I am going the wrong way.
Please guide.
I would make a different job, that deploys to the production, that way you control when it deploys, but that depends on what it is, and how much.
If you are building a package with /t:package you can make it available through artifacts, and use msdeploy -verb:sync -source:package="Path to package" -dest:auto.
In my "deploy to production" job I have this step, as a command line step:
"c:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy.exe" -verb:sync -source:package="%env.deployPackagePath%" -dest:auto,includeAcls=False,wmsvc="%env.msdeploy.serviceurl%?site=%env.msdeploy.Sitename%",userName="%env.msdeploy.username%",password="%env.msdeploy.password%",authType=basic -allowUntrusted -setParam:name="IIS Web Application Name",value="%env.msdeploy.Sitename%"
I'd recommend looking into the Web Farm Framework, which supports deploying to multiple servers and even removing them from (supported) load balancers.

Check deployment to application server after a build with Jenkins

I have a job configured to automatically deploy an application to a running server. I would like to know if Jenkins provides a way to verify if this application was deployed successfully. Ideally, the build should fail when the deployment fails.
Jenkins has a rundeck plugin which might perhaps be useful.
Rundeck deploys the application, and can be setup to trigger a post-deployment build on Jenkins to perform tasks like running integration tests.
Jenkins could be used to report the status of the deployment, however it might make more sense to use rundeck's dashboard instead.

Resources