introduces PUBLISHMETA build step, attempt to pass travis job id
This commit is contained in:
parent
50fcb3b235
commit
96a8004934
38
.travis.sh
38
.travis.sh
|
@ -1,21 +1,32 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# A hacky way of running the unit tests at the same time as the normal builds.
|
# A hacky way of running the unit tests at the same time as the normal builds.
|
||||||
if [ $RUNTESTS ] ; then
|
REVISION=$(git rev-parse --short HEAD)
|
||||||
cd ./src/test && make test
|
|
||||||
else
|
|
||||||
if [ $PUBLISH_URL ] ; then
|
|
||||||
make -j2
|
|
||||||
|
|
||||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
REVISION=$(git rev-parse --short HEAD)
|
REVISION=$(git rev-parse --short HEAD)
|
||||||
RECENT_COMMITS=$(git shortlog -n25)
|
LAST_COMMIT_DATE=$(git log -1 --date=short --format="%cd")
|
||||||
TARGET_FILE=obj/cleanflight_${TARGET}
|
TARGET_FILE=obj/cleanflight_${TARGET}
|
||||||
|
|
||||||
if [ -f ${TARGET_FILE}.bin ];
|
if [ $RUNTESTS ] ; then
|
||||||
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 -j4
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f ${TARGET_FILE}.bin ] ; then
|
||||||
TARGET_FILE=${TARGET_FILE}.bin
|
TARGET_FILE=${TARGET_FILE}.bin
|
||||||
elif [ -f ${TARGET_FILE}.hex ];
|
elif [ -f ${TARGET_FILE}.hex ] ; then
|
||||||
then
|
|
||||||
TARGET_FILE=${TARGET_FILE}.hex
|
TARGET_FILE=${TARGET_FILE}.hex
|
||||||
else
|
else
|
||||||
echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
|
echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
|
||||||
|
@ -26,9 +37,10 @@ else
|
||||||
--form "file=@${TARGET_FILE}" \
|
--form "file=@${TARGET_FILE}" \
|
||||||
--form "revision=${REVISION}" \
|
--form "revision=${REVISION}" \
|
||||||
--form "branch=${BRANCH}" \
|
--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
|
else
|
||||||
make -j2
|
make -j2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
env:
|
env:
|
||||||
- RUNTESTS=True
|
- RUNTESTS=True
|
||||||
|
- PUBLISHMETA=True
|
||||||
- TARGET=CC3D
|
- TARGET=CC3D
|
||||||
- TARGET=CC3D OPBL=yes
|
- TARGET=CC3D OPBL=yes
|
||||||
- TARGET=CHEBUZZF3
|
- TARGET=CHEBUZZF3
|
||||||
|
|
|
@ -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…
Reference in New Issue