Updated travis config

master
João Brázio 9 years ago
parent 7de0161204
commit aa7a65e613
No known key found for this signature in database
GPG Key ID: F62CFD37DFFDB540

@ -3,24 +3,29 @@
DIR="$1" export DIR DIR="$1" export DIR
OUTFILE="$2" export OUTFILE OUTFILE="$2" export OUTFILE
echo "/* This file is automatically generated by an Arduino hook" >"$OUTFILE"
echo " * Do not manually edit it" >>"$OUTFILE" BUILDATE=$(date '+"%s"')
echo " * It does not get committed to the repository" >>"$OUTFILE" DISTDATE=$(date '+"%Y-%m-%d %H:%M"')
echo " */" >>"$OUTFILE"
echo "" >>"$OUTFILE"
cat > "$OUTFILE" <<EOF
echo "#define PROTOCOL_VERSION \"1.0\"" >>"$OUTFILE" /**
echo "#define DEFAULT_SOURCE_URL \"https://github.com/MarlinFirmware/Marlin\"" >>"$OUTFILE" * THIS FILE IS AUTOMATICALLY GENERATED DO NOT MANUALLY EDIT IT.
echo "#define DEFAULT_MACHINE_NAME \"Travis 3D Printer\"" >>"$OUTFILE" * IT DOES NOT GET COMMITTED TO THE REPOSITORY.
echo "#define DEFAULT_MACHINE_UUID \"3442baa1-08ee-435b-8a10-99d185bd43b8\"" >>"$OUTFILE" */
echo "" >>"$OUTFILE"
#define BUILD_UNIX_DATETIME ${BUILDATE}
echo "#define BUILD_UNIX_DATETIME" `date +%s` >>"$OUTFILE" #define STRING_DISTRIBUTION_DATE ${DISTDATE}
echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE" #define PROTOCOL_VERSION "1.0"
echo "" >>"$OUTFILE" #define MACHINE_NAME "Travis CI"
#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
#define DEFAULT_MACHINE_UUID "3442baa1-08ee-435b-8a10-99d185bd43b8"
#define WEBSITE_URL "http://marlinfw.org"
EOF
( set +e ( set +e
cd "$DIR" cd "$DIR"
BRANCH=`git symbolic-ref -q --short HEAD` BRANCH=`git symbolic-ref -q --short HEAD`
if [ "x$BRANCH" == "x" ] ; then if [ "x$BRANCH" == "x" ] ; then
BRANCH="" BRANCH=""
@ -29,6 +34,7 @@ echo "" >>"$OUTFILE"
else else
BRANCH=" $BRANCH" BRANCH=" $BRANCH"
fi fi
VERSION=`git describe --tags --first-parent 2>/dev/null` VERSION=`git describe --tags --first-parent 2>/dev/null`
if [ "x$VERSION" != "x" ] ; then if [ "x$VERSION" != "x" ] ; then
echo "#define SHORT_BUILD_VERSION \"$VERSION\"" | sed "s/-.*/$BRANCH\"/" >>"$OUTFILE" echo "#define SHORT_BUILD_VERSION \"$VERSION\"" | sed "s/-.*/$BRANCH\"/" >>"$OUTFILE"
@ -38,8 +44,4 @@ echo "" >>"$OUTFILE"
echo "#define SHORT_BUILD_VERSION \"$BRANCH\"" >>"$OUTFILE" echo "#define SHORT_BUILD_VERSION \"$BRANCH\"" >>"$OUTFILE"
echo "#define DETAILED_BUILD_VERSION \"${BRANCH}-$VERSION\"" >>"$OUTFILE" echo "#define DETAILED_BUILD_VERSION \"${BRANCH}-$VERSION\"" >>"$OUTFILE"
fi fi
URL=`git config --local --get remote.origin.url | sed "sx.*github.com.xhttps://github.com/x" | sed "sx\.gitx/x"`
if [ "x$URL" != "x" ] ; then
echo "#define SOURCE_CODE_URL \""$URL"\"" >>"$OUTFILE"
fi
) )

Loading…
Cancel
Save