Skip to content

Commit

Permalink
scripts+travis+firmware: Add branch name to version.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Jan 28, 2016
1 parent 07f8476 commit 89f0457
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .travis/run.sh
Expand Up @@ -87,20 +87,25 @@ for BOARD in $BOARDS; do
fi

# Copy built files
if [ -z $GH_TOKEN ]; then
if [ -z "$GH_TOKEN" ]; then
# Only if run by travis display error
if [ ! -z $TRAVIS_BUILD_NUMBER ]; then
echo ""
echo ""
echo ""
echo "- No Github token so unable to copy built files"
fi
elif [ -z "$TRAVIS_BRANCH" ]; then
echo ""
echo ""
echo ""
echo "- No branch name, unable to copy built files"
else
# Look at repo we are running in to determine where to try pushing to if in a fork
COPY_REPO_OWNER=$(echo $TRAVIS_REPO_SLUG|awk -F'/' '{print $1}')
echo "COPY_REPO_OWNER = $COPY_REPO_OWNER"
COPY_REPO="HDMI2USB-firmware-prebuilt"
GIT_REVISION=`git describe`
GIT_REVISION=$TRAVIS_BRANCH/$(git describe)
COPY_DEST="archive/$GIT_REVISION/$BOARD/$TARGET"
ORIG_COMMITTER_NAME=$(git log -1 --pretty=%an)
ORIG_COMMITTER_EMAIL=$(git log -1 --pretty=%ae)
Expand Down
1 change: 1 addition & 0 deletions firmware/lm32/version.c
Expand Up @@ -58,6 +58,7 @@ void print_version(void) {
printf("firmware version info\r\n");
printf("===============================================\r\n");
printf(" git commit: %s\n", git_commit);
printf(" git branch: %s\n", git_branch);
printf(" git describe: %s\n", git_describe);
printf(" git status:\n%s\n", git_status);
printf(" built: "__DATE__" "__TIME__"\r\n");
Expand Down
1 change: 1 addition & 0 deletions firmware/lm32/version_data.sh
Expand Up @@ -2,6 +2,7 @@
cat > version_data.h <<EOF
const char* git_commit = "$(git log --format="%H" -n 1)";
const char* git_branch = "$(git symbolic-ref --short HEAD)";
const char* git_describe = "$(git describe --dirty)";
const char* git_status =
" --\n"
Expand Down
2 changes: 1 addition & 1 deletion scripts/download-prebuilt.sh
Expand Up @@ -14,7 +14,7 @@ if [ ! -e $BUILD_DIR ]; then
exit 1
fi

CURRENT_GIT_REVISION=$(git describe)
CURRENT_GIT_REVISION=$(git symbolic-ref --short HEAD)/$(git describe)

: ${BOARD:="atlys"}
: ${TARGET:="hdmi2usb"}
Expand Down

0 comments on commit 89f0457

Please sign in to comment.