Closed SebKuzminsky closed 6 years ago
Hmm, that failed Travis PR build is somehow from PR #87, which I erroneously opened against master and then immediately closed. The PR #88 build passed (though the logs are not available?): https://travis-ci.org/SebKuzminsky/pycam/builds/293491700
We want to use the git branch name to help figure out the pycam version number, but travis-ci's git handling means our job runs with a detached HEAD (ie, with no branch set).
This commit figures out the branch name from the travis job's environment variables, and manipulates git to set the branch name appropriately.
Branch names are constructed like this:
When building a push, use the name of the branch that was pushed to (of course).
Github presents each PR as a new merge commit in the destination branch, merging in the new branch. In this case, use "${DEST_BRANCH}-${NEW_BRANCH}-pr${PR_NUMBER}", for example "stable/0.6-0.6-travis-branch-name-pr87".