I’ve been experimenting over the last few days with Octopus deploy, and one of the things I’ve been looking at trying to implement is a Continuous Integration build using TFS.
I’ve added Octopack to the projects I want to build in my solution, and that works fine, I can generate the nuget packages and push them to my repository. Then I created an empty project in VS2013, added Octo,exe and the config file to it, and a batch file that contains the following
octo create-release --project myproject–deployto Dev --server http://myserver:81/api --apiKey API-myapikeyhere > deploylog.txt 2>&1 --progress
The TFS part of the build seems to work okay - Octopack is running and pushing packages to the repository, but when I call the batch file as a post build event it comes back with the following
Exception Message: TF270015: ‘deployDev.bat’ returned an unexpected exit code. Expected ‘0’; actual ‘1’. See the build logs for more details.
I’m using the Default Template within TFS 2013, if I take the post-build script out it all works - this is the last step and I’ve been tearing my hair out all day with it!
Anyone got any thoughts?
Thanks for getting in touch! Your server address looks incorrect. You do not need to call the api - just
http://myserver:81/ should do it.
If this doesn’t resolve the issue for you, your error message includes "See the build logs for more details."
Are you able to provide the full build logs for us?
Still no joy
I tried amending the batch file like you suggested and I’m still getting the same error.
First I tried
octo create-release --project myproject–deployto Dev --server http://myserver:81/ --apiKey API-myapikeyhere > deploylog.txt 2>&1 --progress
octo create-release --project myproject–deployto Dev --server http://myserver:81/ > deploylog.txt 2>&1 --progress
I can see that the package has built on the build server, and copied the batch file over, it just seems to either not run it, or error. I’m not really sure which one as the log files show it being copied over, but don’t give me any feedback about running it.
I’ve attached a version of the build logs (names have been changed to protect the innocent )
I’m also wondering if my batch file should be a powershell file? Would that make a difference?
myproject.log (1 MB)
Problem solved - I found the log file from the deployment, and it was telling me that octo.exe wasn’t a recognised command. So I added it to the PATH environment variable on the server, rebooted, retried…
That is great! I am glad you are up and running!