Capistrano -- the task `staging:symlink' does not exist - deployment

I'm attempting to deploy to a server via Capistrano and I keep getting the error the task `staging:symlink' does not exist.
I've run cap:deploy setup and cap deploy successfully getting the releases and shared directories created but the above error always shows at the end and I think it's stopping my code from getting moved to the root of the directory where it belongs.
I'm new at using Capistrano and I've Googled the issue but I cannot find anything that helps. I can include my code and everything I just don't know what to show to help... let me know!
Thanks for any help you can provide!

The built-in symlink task for capistrano 2.x is cap deploy:symlink.
staging:symlink is not a valid task, unless you've defined it yourself. If you're not defining this, you are accidentally calling it somewhere in your config files (deploy.rb or one of your staging config files, if you're using multistage).
Additionally, deploy:symlink should be called automatically as part of the deploy task. You don't need to call it manually.

Related

Test-ServiceFabricApplicationPackage Settings.xml already exists

I am using sdk 3.3.622.9590 and having some difficulty deploying my application using powershell.
The error is like follows:
Test-ServiceFabricApplicationPackage : The file 'C:\Users\xxx\A
ppData\Local\Temp\TestApplicationPackage_740405352\n2r3lbmn.zlv\Release(service name)\Config\Settings.xml' already exists.
At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricS
DK\Publish-NewServiceFabricApplication.ps1:163 char:38
+ ... tionSuccess = (Test-ServiceFabricApplicationPackage $AppPkgPathToUse)
My application structure is like this
Applicaiton Folder
Service 1
Code
Config
Settings.xml
ServiceManifest.xml
Service 2...
I managed to deploy twice, but the other times it all failed with the same error.
I am new to SF and powershell. Can someone please help me and point me to the right direction?
Thanks!
Just in case it may help anyone who hits this, we were using a self-hosted agent to run the pipeline. Switching the fabric publish task to use an Azure hosted agent seems not to exhibit the same problem.
Hope this helps
Mark
As a short term workaround - until Microsoft fix the issue formally, I've managed to mitigate the problem...
What was needed was to ensure that the workspace was cleaned before each and every action involving the application. Build and each release stage.
My specific instance was when using the multi-stage YAML file for build and deployment so adding in a workspace: clean was what was needed.
I still have a support ticket with Microsoft for a more formal fix.

Custom Action not being fired

Recently, I was assigned the task to create a deployment package for an application which btw, I'm totally new at. So far, so good.. Now there is a requirement to extract files from a zip file which will be bundled with the setup file. So, I had to write custom actions in the 'Commit' section of the Installer class. I added the Installer class in a new project of type 'Class Library' under the same solution. I wrote the code after 'base.Commit(savedState)'.
I tried showing MessageBox at the event entry point, used Debugger.Launch(), Debugger.Break() but somehow, no matter what I do, it seems that the custom action is not willing to be hit at all and the application just installs itself. I searched a lot of sites and blogs but no help so far.
I've assigned my installer class (SampleApp.exe, in my case) to all the Custom Action's modes (Install, Commit, Rollback and Uninstall) in the Deployment project. Any help.
P.S. I'm using a Visual Studio 2010 setup project.
Thanks, in advance!
You should probably be trying a class library Dll, not an executable (which is typically for something like a service).
You don't need it all the nodes if all you're doing is calling at Commit. And why Commit? Install is just the same in most cases.
If you're not seeing a MessageBox then probably your CA isn't being called, and that may because it's not a class library. Note that your CA is not running in the interactive user context - it's being called from an msiexec process running with the system account, so you must be very explicit about (say) the path to the zip file, and any user profile folders will probably fail because the system account doesn't really have them.
What files are these and where are they going on disk? If they are user profile files you can install the zip files to a per machine location and then have the application itself unzip the files to the desired location on first launch. Unzipping from within your setup is not good practice - it is error prone and bad design.
Using the application allows proper exception handling and interactivity (the user can be informed if something goes wrong). Set some registry flags in HKCU when you have completed the unzipping so it doesn't happen more than once, and perform the unzip once per user.

How do you access rails_env from the Cap deploy command?

In deploy.rb, I believe that :rails_env is typically set by require 'capistrano/rails' found in your Capfile. I am using rails, but not using the built in asset pipeline and therefore, don't use capistrano/rails and was in the predicament of having to manually set :rails_env in deploy.rb when switching between staging and production deploys. This seemed rather silly as the environment is always included when executing cap staging deploy or cap production deploy. I am posting this question, as it seems like it could be a fairly common pain point with a trivial solution, but after much googling, I came up empty-handed. I therefore dug into the Capistrano 3.1.0 source code to figure out how to access the stage variable entered on the command line and will follow up with a brief answer that does a bit of explaining.
The simple answer is to add the following line near the top of deploy.rb:
set :rails_env, fetch(:stage)
The variable :stage gets set in capistrano/setup which is required in your Capfile. This script creates rake tasks for each stage that is defined in config/deploy. Inside the definition for the rake task you will find the following: set(:stage, stage.to_sym) which is the stage/rails_env variable from your cap staging deploy or cap production deploy command.

How to deploy a process from Signavio into jBPM?

I've installed jBPM 4.4 and it looks neat. I've edited a little example process using Signavio, and I'd like to deploy it on the demo server (ant demo.setup.jboss) so that I can see how it works. But I can't figure out how to do that.
I feel like I'm missing something obvious...
Is the .jpdl.xml file all you need for a very basic deployment? Is there a tutorial going through every step of defining a process and deploying it?
Thanks!
you can specify the path where signavio stores the files in the web.xml directory by setting the fileSystemRootDirectory context-param. Then use the jbpm-console to deploy the process from the same directory

build failed executing nant

I've got a nant build script (.86 beta) and it is telling me this:
BUILD FAILED
Failed to initialize the 'Microsoft
.Net Framework 2.0' target
framework.
The process cannot access the file
'C:\Users\cconway\AppData\Local\Temp\tmp25E3.tmp'
because it is being used by another
process.
This file does not even exist on my machine. Does anyone know the cause of this? Rebooting seems to allow me to run the script once successfully, but every time after that I get this message (though the name of the tmp file changes per reboot).
Thanks!
Are there any third-party tasks which might leave temp files open or keep running in the background, thus leaving file locked?
Maybe try sysinternals process monitor which will allow you to see the process which has the handle on this file.
Also, make sure that you have all the right versions of .Net installed and they are the correct ones (SDK vs Runtime). If you open the config file for nant you can see where it expects the .net version to be go check to make sure it's there and that you can see hte compiler methods (csc, vbc, etc). So it could have something that is trying to find it but it's not there or the pathing is off.
It is beta so there could even be a typo in the config file.
The answer is my anti-virus. I should have tried disabling that first! Once I disabled it, everything worked like a charm.
Hope this helps someone.