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.
Details
Details
- Reviewers
sdulfari - Group Reviewers
Restricted Project - Commits
- rABC512d1605ccaa: [CI] Use a random port for the website preview
./contrib/teamcity/build-configurations.py preview-e.cash
Check the preview URL is working as expected.
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
contrib/teamcity/build-configurations.py | ||
---|---|---|
205 ↗ | (On Diff #39548) | Nit: This does not check if outer_port is available. To dodge this you could something like: outer_port = 41000 + hour_of_the_day * 100 + int(self.project_commit) % 100 but this does seem complicated. Only marked as a nit since this is expected to be distributed over multiple machines, so collisions are not very likely at our current rate of website changes. |
contrib/teamcity/build-configurations.py | ||
---|---|---|
205 ↗ | (On Diff #39548) | That complicated computation doesn't prevent picking a port that's already in use either. My expectation is that the range is large enough wrt the number of calls and the number of agents that it doesn't really matter. If we start getting collisions we can always rework this. |