Anyone know how can I detect when Circle is running with SSH enabled?
i.e if the current run is a standard one or a re-run with SSH enabled.
JIC ur curious we running automated UI test, which we preload data into the DB for them to run, once they run the DB they can’t run again unless we clear the DB and re-load it, so we wanna skip the test execution in case SSH is enabled so we can run the tests manually and see what’s going on.
You could use the special deploy step to set a custom environment variable when your job is not being rerun with SSH.
For example:
- deploy:
name: Check if being rerun with SSH
command: echo 'export REGULAR_RUN=true' >> $BASH_ENV
- run:
command: |
if [ $REGULAR_RUN ]; then
echo "regular run"
else
echo "rerun with SSH"
fi