Guard copy of artifacts on existence
- Hopefully, this stop the situation where a partial build still exports
artifacts, and breaks the 'latest' build symlink...
Change-Id: I5bfbaecab6b047816976926390952b36ff4c60b0
diff --git a/kokoro/continuous.sh b/kokoro/continuous.sh
index d4759f1..f0e6864 100644
--- a/kokoro/continuous.sh
+++ b/kokoro/continuous.sh
@@ -35,10 +35,16 @@
-o ${KOKORO_ARTIFACTS_DIR}/manifest.xml
popd
-cp ${ROOTDIR}/board/flash.sh ${KOKORO_ARTIFACTS_DIR}
-chmod -x ${KOKORO_ARTIFACTS_DIR}/flash.sh
-cp ${PRODUCT_OUT}/u-boot.imx ${KOKORO_ARTIFACTS_DIR}
-cp ${PRODUCT_OUT}/boot.img ${KOKORO_ARTIFACTS_DIR}
-cp ${PRODUCT_OUT}/partition-table-*.img ${KOKORO_ARTIFACTS_DIR}
-cp ${PRODUCT_OUT}/rootfs.img ${KOKORO_ARTIFACTS_DIR}
-cp ${PRODUCT_OUT}/sdcard.img ${KOKORO_ARTIFACTS_DIR}
+if [[ -f ${PRODUCT_OUT}/u-boot.imx && \
+ -f ${PRODUCT_OUT}/boot.img && \
+ -f ${PRODUCT_OUT}/partition-table-8gb.img && \
+ -f ${PRODUCT_OUT}/rootfs.img && \
+ -f ${PRODUCT_OUT}/sdcard.img ]]; then
+ cp ${ROOTDIR}/board/flash.sh ${KOKORO_ARTIFACTS_DIR}
+ chmod -x ${KOKORO_ARTIFACTS_DIR}/flash.sh
+ cp ${PRODUCT_OUT}/u-boot.imx ${KOKORO_ARTIFACTS_DIR}
+ cp ${PRODUCT_OUT}/boot.img ${KOKORO_ARTIFACTS_DIR}
+ cp ${PRODUCT_OUT}/partition-table-*.img ${KOKORO_ARTIFACTS_DIR}
+ cp ${PRODUCT_OUT}/rootfs.img ${KOKORO_ARTIFACTS_DIR}
+ cp ${PRODUCT_OUT}/sdcard.img ${KOKORO_ARTIFACTS_DIR}
+fi