How do I add the job status (success or failure) in the email notification? - octopus-deploy

I want to add the job status in the subject line of the email notification of Octopus Deploy. Can you please tell me the system variable to use or another way to add the status?

As a work-around you could use two steps for sending the 'status-email':
One step sending 'success'-email. This step should have its 'Run condition' set to 'Success: only run when previous steps are successfull'.
Another step sending 'failure'-email. This step should have 'Run condition' set to 'Failure: only run when a previous step failed'.
Perhaps the system-variables Octopus.Deployment.Error
Octopus.Deployment.ErrorDetail could also be helpfull.

Tracking deployment status
During deployment, Octopus provides variables describing the status of each step.
Where S is the step name, Octopus will set:
Octopus.Step[S].Status.Code
Octopus.Step[S].Status.Error
Octopus.Step[S].Status.ErrorDetail
Status codes include Pending, Skipped, Abandoned, Cancelled, Running, Succeeded and Failed.
Source: http://docs.octopusdeploy.com/display/OD/System+variables#Systemvariables-DeploymentStatusTrackingdeploymentstatus
So to apply this to your email subject (assuming you're using the inbuilt Send Email step:
FYI: the box circled allows you quick access to the variables list.
You probably want to tweak the value to be closer to this, though
Deployment Status = #{Octopus.Step[Other Step Name].Status.Code}
As an extension to this answer; you can iterate over all steps and output their status, I guess.
Syntax here: http://docs.octopusdeploy.com/display/OD/Variable+Substitution+Syntax#VariableSubstitutionSyntax-Repetition (look for the Repetition heading)
Write-Host "Deployment Steps:"
#{each step in Octopus.Step}
Write-Host "- StepName=#{step}; Status=#{step.Status.Code};"
#{/each}
Example output
Deployment Steps:
StepName=FirstStep; Status=Succeeded;
StepName=ThisStep; Status=Running;
StepName=YetToBeRun; Status=Pending;

You could use variable expressions and deployment error variable to achieve this in email subject field. For example:
State of deployment: #{unless Octopus.Deployment.Error}Success#{/unless} #{if Octopus.Deployment.Error}Failure#{/if}

Related

How can i have 2 input link in DataStage sequence job?

As you can see that when the SEQ_DIM_ACCOUNT Job executed it has 2 conditions with Success and Failure.
I wanted to run execute_command_60 when it's failed, but if execute_command_60 has been run, then i wanted the execute_command_60 to get to the SEQ_DIM_BUSINESS_PARTNER, but when i tried to link the execute_command_60 to SEQ_DIM_BUSINESS_PARTNER it gave me an error "the destination stage cannot support any more input links"
Is there a way to do that?
Yes it is possible with the help of a Sequencer stage.
Add that after the Execute_Command and before the SEQ_DIM_BUSINESS_PARTNER. This Stage kan take any number of Input-Links and you only have to specify if All or Any input links have been run to go on

How to get the exact loading time of website in jmeter

Just wanna know if this scenario is possible in jmeter:
I will create a website using docker image then i will have to check the exact accessibility time(from creating up to launching/checking the site). Once the requirement is met, the timer will stop and it will give me the exact time on when it is actually up. Also, in the view result tree, i only want to get the last successful status. The View Result Tree will only show the last successful status and will disregard the failed status. This is the sample of my thread that i am using: enter image description here
If you really want to discard non-successful results you can do this using JSR223 Assertion and the following Groovy code:
if (!prev.isSuccessful()) {
prev.setIgnore()
}
where prev is a shorthand for parent SampleResult and setIgnore() function tells the listener to ignore the result in case of failure.
More information: Scripting JMeter Assertions in Groovy - A Tutorial

HDInsight Error

I am following the steps in the link shown below to use Hadoop 2.2 clusters with HDInsight. http://azure.microsoft.com/en-us/documentation/articles/hdinsight-get-started-30/
In the "Run a Word Count Map Reduce Job"section I am having difficulty getting the message to take for step 4. In the PowerShell I type in the following commands:
Submit the job
Select-AzureSubscription $subscriptionName
$wordCountJob = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $wordCountJobDefinition
I keep getting an error that states there is a ParameterArgumentValidationError. What command could I use to avoid getting these errors?
I am new to using Azure and could really use some help :)
Those are two separate cmdlets:
The first one is:
Select-AzureSubscription $subscriptionName
If you only have only one subscription with your azure account, you can skip this cmdlet.
The second cmdlet is:
$wordCountJob = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $wordCountJobDefinition

Google Analytics funnel ignore steps

I have following problem with tracking of Magento purchase on Google Analytics (custom theme, different from default checkout process).
My goal settings are following: http://db.tt/W30D0CnL, where step 3 equals to /checkout/onepage/opc-review-placeOrderClicked
As you can see from funnel visualization ( http://db.tt/moluI29d ) after step 2 (Checkout Start) there are a lot of exits toward /checkout/onepage/opc-review-placeOrderClicked which is setted as step 3, but step 3 reporting always 0.
Is there something that I'm missing here?
I've found the problem. Apparently second point (/checkout/onepage) was fired even on the third step.
When I changed it to regex match (/checkout/onepage$) everything started to work.

Why are my delayed_job jobs re-running even though I tell them not to?

I have this in my initializer:
Delayed::Job.const_set( "MAX_ATTEMPTS", 1 )
However, my jobs are still re-running after failure, seemingly completely ignoring this setting.
What might be going on?
more info
Here's what I'm observing: jobs with a populated "last error" field and an "attempts" number of more than 1 (10+).
I've discovered I was reading the old/wrong wiki. The correct way to set this is
Delayed::Worker.max_attempts = 1
Check your dbms table "delayed_jobs" for records (jobs) that still exist after the job "fails". The job will be re-run if the record is still there. -- If it shows that the "attempts" is non-zero then you know that your constant setting isn't working right.
Another guess is that the job's "failure," for some reason, is not being caught by DelayedJob. -- In that case, the "attempts" would still be at 0.
Debug by examining the delayed_job/lib/delayed/job.rb file. Esp the self.workoff method when one of your jobs "fail"
Added #John, I don't use MAX_ATTEMPTS. To debug, look in the gem to see where it is used. Sounds like the problem is that the job is being handled in the normal way rather than limiting attempts to 1. Use the debugger or a logging stmt to ensure that your MAX_ATTEMPTS setting is getting through.
Remember that the DelayedJobs jobs runner is not a full Rails program. So it could be that your initializer setting is not being run. Look into the script you're using to run the jobs runner.

Resources