diff --git a/release/build_release2.sh b/release/build_release2.sh index 08f727b1b2..7893c763d0 100755 --- a/release/build_release2.sh +++ b/release/build_release2.sh @@ -8,36 +8,45 @@ export GIT_AUTHOR_EMAIL="user@comma.ai" export GIT_SSH_COMMAND="ssh -i /data/gitkey" -# Create folders -rm -rf /data/openpilot -mkdir -p /data/openpilot -cd /data/openpilot - -# Create git repo -git init -git remote add origin git@github.com:commaai/openpilot.git -git fetch origin devel +# set CLEAN to build outside of CI +if [ ! -z "$CLEAN" ]; then + # Create folders + rm -rf /data/openpilot + mkdir -p /data/openpilot + cd /data/openpilot + + # Create git repo + git init + git remote add origin git@github.com:commaai/openpilot.git + git fetch origin devel-staging +else + cd /data/openpilot + git clean -xdf + git branch -D release2-staging || true +fi + git fetch origin release2-staging git fetch origin dashcam-staging -# Checkout devel -#git checkout origin/devel -#git clean -xdf - # Create release2 with no history -git checkout --orphan release2-staging origin/devel +if [ ! -z "$CLEAN" ]; then + git checkout --orphan release2-staging origin/devel-staging +else + git checkout --orphan release2-staging +fi VERSION=$(cat selfdrive/common/version.h | awk -F\" '{print $2}') git commit -m "openpilot v$VERSION" # Build signed panda firmware pushd panda/board/ -cp -r /tmp/pandaextra /data/openpilot/ -RELEASE=1 make obj/panda.bin +#cp -r /tmp/pandaextra /data/openpilot/ +#RELEASE=1 make obj/panda.bin +make obj/panda.bin mv obj/panda.bin /tmp/panda.bin make clean mv /tmp/panda.bin obj/panda.bin.signed -rm -rf /data/openpilot/pandaextra +#rm -rf /data/openpilot/pandaextra popd # Build stuff @@ -60,6 +69,9 @@ rm .sconsign.dblite # Restore phonelibs git checkout phonelibs/ +# Remove the stuff needed to build release +rm -rf release/ + # Mark as prebuilt release touch prebuilt @@ -70,11 +82,17 @@ git commit --amend -m "openpilot v$VERSION" # Print committed files that are normally gitignored #git status --ignored -# Push to release2-staging -git push -f origin release2-staging +if [ ! -z "$CI_PUSH" ]; then + git remote set-url origin git@github.com:commaai/openpilot.git + + # Push to release2-staging + #git push -f origin release2-staging + git push -f origin release2-staging:r2_staging_test -# Create dashcam release -git rm selfdrive/car/*/carcontroller.py + # Create dashcam release + git rm selfdrive/car/*/carcontroller.py -git commit -m "create dashcam release from release2" -git push -f origin release2-staging:dashcam-staging + git commit -m "create dashcam release from release2" + #git push -f origin release2-staging:dashcam-staging + git push -f origin release2-staging:d_staging_test +fi diff --git a/selfdrive/test/phone_ci.py b/selfdrive/test/phone_ci.py index 1c84b9a50d..d7e6e8f0c4 100755 --- a/selfdrive/test/phone_ci.py +++ b/selfdrive/test/phone_ci.py @@ -52,6 +52,8 @@ def run_on_phone(test_cmd): conn.send(f"cd {SOURCE_DIR}\n") conn.send("git reset --hard\n") conn.send("git fetch origin\n") + conn.send("find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \\;\n") + conn.send(f"git reset --hard {commit}\n") conn.send(f"git checkout {commit}\n") conn.send("git clean -xdf\n") conn.send("git submodule update --init\n")