[CI] Use a random port for the website preview
Summary:
And write the generated preview URL to both stdout and a log file so it can be later retrieved by the build bot. The IP used is localhost if it's not running on a Teamcity build agent, and the public IP otherwise. To achieve that, the whatismyip package is used.
The port is randomly selected in a range free of known use.
Test Plan:
./contrib/teamcity/build-configurations.py preview-e.cash
Check the preview URL is working as expected.
Reviewers: #bitcoin_abc, sdulfari
Reviewed By: #bitcoin_abc, sdulfari
Subscribers: sdulfari
Differential Revision: https://reviews.bitcoinabc.org/D13667