Browse Source

introduces PUBLISHMETA build step, attempt to pass travis job id

master
Paul Rogalinski 10 years ago
parent
commit
96a8004934
  1. 36
      .travis.sh
  2. 1
      .travis.yml
  3. 19
      fake_travis_build.sh

36
.travis.sh

@ -1,34 +1,46 @@
#!/bin/bash
# A hacky way of running the unit tests at the same time as the normal builds.
REVISION=$(git rev-parse --short HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REVISION=$(git rev-parse --short HEAD)
LAST_COMMIT_DATE=$(git log -1 --date=short --format="%cd")
TARGET_FILE=obj/cleanflight_${TARGET}
if [ $RUNTESTS ] ; then
cd ./src/test && make test
elif [ $PUBLISHMETA ] && [ $PUBLISH_URL ] ; then
RECENT_COMMITS=$(git shortlog -n25)
echo publishing
curl \
--form "recent_commits=${RECENT_COMMITS}" \
--form "revision=${REVISION}" \
--form "branch=${BRANCH}" \
--form "last_commit_date=${LAST_COMMIT_DATE}" \
--form "travis_job_id=${TRAVIS_JOB_ID}" \
${PUBLISH_URL}
else
if [ $PUBLISH_URL ] ; then
make -j2
make -j4
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REVISION=$(git rev-parse --short HEAD)
RECENT_COMMITS=$(git shortlog -n25)
TARGET_FILE=obj/cleanflight_${TARGET}
if [ -f ${TARGET_FILE}.bin ];
then
if [ -f ${TARGET_FILE}.bin ] ; then
TARGET_FILE=${TARGET_FILE}.bin
elif [ -f ${TARGET_FILE}.hex ];
then
elif [ -f ${TARGET_FILE}.hex ] ; then
TARGET_FILE=${TARGET_FILE}.hex
else
echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
exit 1
fi
fi
curl \
--form "file=@${TARGET_FILE}" \
--form "revision=${REVISION}" \
--form "branch=${BRANCH}" \
--form "recent_commits=${RECENT_COMMITS}" ${PUBLISH_URL}
--form "last_commit_date=${LAST_COMMIT_DATE}" \
--form "travis_job_id=${TRAVIS_JOB_ID}" \
${PUBLISH_URL}
else
make -j2
fi
fi

1
.travis.yml

@ -1,5 +1,6 @@
env:
- RUNTESTS=True
- PUBLISHMETA=True
- TARGET=CC3D
- TARGET=CC3D OPBL=yes
- TARGET=CHEBUZZF3

19
fake_travis_build.sh

@ -0,0 +1,19 @@
#!/bin/bash
targets=("PUBLISHMETA=True" "RUNTESTS=True" \
"TARGET=CC3D" "TARGET=CC3D OPBL=yes" "TARGET=CHEBUZZF3" "TARGET=CJMCU" \
"TARGET=EUSTM32F103RC" "TARGET=SPRACINGF3" "TARGET=NAZE" "TARGET=NAZE32PRO" \
"TARGET=OLIMEXINO" "TARGET=PORT103R" "TARGET=SPARKY" "TARGET=STM32F3DISCOVERY" \
"TARGET=ALIENWIIF1" "TARGET=ALIENWIIF3")
export TRAVIS_JOB_ID=$(date +%s)
for target in "${targets[@]}"
do
unset RUNTESTS PUBLISHMETA TARGET OPBL
eval "export $target"
make clean
./.travis.sh
done
Loading…
Cancel
Save