Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
travis: More refactoring.
 - Remove old broken symlink code.
 - Actually commit the symlink.
  • Loading branch information
mithro committed Jul 22, 2017
1 parent e362df9 commit 55458d2
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions .travis/build.sh
Expand Up @@ -196,15 +196,6 @@ function build() {
cp $TARGET_BUILD_DIR/software/firmware/version_data.c $COPY_DEST/logs/version_data.c
cp $TARGET_BUILD_DIR/output.*.log $COPY_DEST/logs/

# Only hdmi2usb + lm32 is considered usable at the moment
UNSTABLE_LINK="$PLATFORM/firmware/unstable"
if [ "$TARGET" = "hdmi2usb" -a "$CPU" = "lm32" ]; then
# Create link to latest unstable build
rm $UNSTABLE_LINK
ln -s ../../$COPY_DEST $UNSTABLE_LINK
echo ""
echo "- Added symlink of $UNSTABLE_LINK -> $COPY_DEST"
fi
(
cd $COPY_DEST
sha256sum $(find -type f) > sha256sum.txt
Expand Down Expand Up @@ -341,7 +332,7 @@ if [ ! -z "$PREBUILT_DIR" ]; then
for i in 1 2 3 4 5 6 7 8 9 10; do # Try 10 times.
if [ "$TRAVIS_BRANCH" = "master" ]; then
echo
echo "Updating unstable link"
echo "Updating unstable link (Try $i)"
echo "---------------------------------------------"
for PLATFORM in $PLATFORMS; do
(
Expand All @@ -351,30 +342,36 @@ if [ ! -z "$PREBUILT_DIR" ]; then
cd $PLATFORM/firmware
LATEST="$(ls ../../archive/master/ | tail -n 1)"
HDMI2USB_FIRMWARE="$LATEST/$PLATFORM/hdmi2usb/lm32"
echo "Checking for '$HDMI2USB_FIRMWARE'"
if [ -d "$HDMI2USB_FIRMWARE" ]; then
echo "Changing $PLATFORM from '$(readlink unstable)' to '$HDMI2USB_FIRMWARE'"
ln -sf unstable "$HDMI2USB_FIRMWARE"
git add unstable
git commit -a \
-m "Updating unstable link (Travis build #$TRAVIS_BUILD_NUMBER of $GIT_REVISION for PLATFORM=$PLATFORM TARGET=$TARGET CPU=$CPU)" \
-m "" \
-m "From https://github.com/$TRAVIS_REPO_SLUG/tree/$TRAVIS_COMMIT" \
-m "$TRAVIS_COMIT_MESSAGE"
else
echo "Not updating $PLATFORM"
fi
)
done
fi
echo
echo "Changes to be pushed"
echo "Merging (Try $i)"
echo "---------------------------------------------"
git diff origin/master --stat=1000,1000
git diff --stat origin/master && break
git fetch
git merge origin/master -m "Merging #$TRAVIS_JOB_NUMBER of $GIT_REVISION"
echo
echo "Pushing"
echo "Changes to be pushed (Try $i)"
echo "---------------------------------------------"
git push --quiet origin master > /dev/null 2>&1 && break
git diff origin/master --stat=1000,1000
echo
echo "Merging"
echo "Pushing (Try $i)"
echo "---------------------------------------------"
git diff --stat origin/master && break
git fetch
git merge origin/master -m "Merging #$TRAVIS_JOB_NUMBER of $GIT_REVISION"
git push --quiet origin master > /dev/null 2>&1 && break
done
echo
echo "Push finished!"
Expand Down

0 comments on commit 55458d2

Please sign in to comment.