AppHarbor Tips

Some tips I have discovered on using AppHarbor as a PaaS.

Tracking Branches

AppHarbor has a great new feature called Tracking Branch (find it under the Settings for your application) that allows you to specify a specific branch for them to track.

This is super useful because otherwise, AppHarbor will be building and tracking every branch in your repo and since the build status only includes 10 entries, failed builds can add up really quick. This means that if you need to rollback a build, you cannot if you have lots of broken builds. In the past, I would have to create multiple repositories and only have AppHarbor watch my “production” repo, now I can specify a “production” branch, merge changes into the production branch and push it to origin.

BUT … some providers like BitBucket do not publish notifications if there are no commits and if a merge can be fast forwarded there are no commits. So when merging in to your tracking branch use the --no-ff flag.

Your workflow then may look something like this:

git commit
git push origin master
git checkout production
git merge master --no-ff
git push origin production

AppHarbour should then pick up the changes and start the build.

Here is a link to an AppHarbor support discussion about this.

http://support.appharbor.com/discussions/problems/21359-dont-understand-tracking-branch

NuGet Error: The process cannot access the file

I was constantly getting this problem and it would take four or five “pokes” to get a successful build.

Turns out the problem is that AppHarbor runs builds in parallel and if you have projects that depend on the same package, one build may be using that package and therefor the other builds may not be able to access it.

I am using NuGet 2.6 and I have heard that this problem may be resolved in the next release.

To solve the problem in the meantime, you can disable caching of the packages. This is done adding a –nocache flag to the RestoreCommand of the NuGet.targets file.

Open your NuGet.targets file and you should find a RestoreCommand element. Add the –nocache flag to the end of the element as such:

  <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)"  $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " -nocache </RestoreCommand>

Link to AppHarbor discussion:

http://support.appharbor.com/discussions/problems/35303-build-consistently-fails-due-to-nuget-error

TrackBack

TrackBack URL for this entry:
https://www.typepad.com/services/trackback/6a0133ecbab7ab970b01901eab0cb9970b

Listed below are links to weblogs that reference AppHarbor Tips:

Comments

You can follow this conversation by subscribing to the comment feed for this post.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment