I have tried few methods like(looping through files and merging in bash script in Run a Script) , inline assets from cypress. Alternatively my Visual Studio code outputs one merged file when used with cypress multi reporters and cypress mochawesome reporter within cypress.config.js file
And Octopus Deploy doesn’t seem to be doing the same job of merging the files instead creates blank file or just ends up with one html file contents.
Happy to provide more info in this regard if need be.
Octopus is essentially just a script runner for this kind of action, so anything that works in Powershell or Bash outside of Octopus should work when run as part of a deployment process.
Looking at your original screenshot, I noticed that the script step runs on a worker. Is this a different machine from the deployment target on which the IIS deploy step is running? Would the script you’re attempting to run need to be executed on the same machine on which the deployment occurs?
Yes you are right, the first option of looping through the files and merging should have worked but its not on OD. Its overwriting the files instead of appending. Which was the hope i had for an merged html file.
Yes, they are two different machines IIS deploy(windows) and Worker(Ubuntu). Worker is on Ubuntu where cypress smoke tests run within a container and outputs the results.
Thanks for sending over that script for our team to review.
It looks like you’re echoing each complete HTML file into the output file. This will technically put all of the data into the output file but browsers will only render the first instance of the tags <HTML> to </HTML>.
If you want all results to be rendered, all of the data for each file would need to be between these tags. I’m not an expert in bash, but this Stackoverflow article had a pretty good answer to help merge the content of files between headers. Hopefully you can adapt this to your use case.
Please let us know if that helps get you a bit further.