Use file locking to preserve state of Runner across different processes
Following the discussion here: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/219
I prefer to use lock files to save a state of Runner and share this state across different machines:
~/.gitlab-runner/config.toml
~/.gitlab-runner/certs.d/hostname.crt
~/.gitlab-runner/runners/12345321/builds/10.json
~/.gitlab-runner/runners/12345321/1.lock
~/.gitlab-runner/runners/12345321/projects/123/0.lock
~/.gitlab-runner/machines/runner-132321312-machine-1-32132.lock
This allows us to implement statistics, seamless upgrade of runner binary, etc.