build/vcs-test
Dmitri Shuralyov 5131ae92c5 vcs-test/vcweb: move init to main
The storage client and bucket are needed while the program is running,
not for any of the tests. Move the init code to main so x/build tests
can work okay on a machine without Application Default Credentials.

Change-Id: I3da39cace35588ffa0fb7cc2b5a93b8bfc3f594e
Reviewed-on: https://go-review.googlesource.com/c/build/+/447300
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-03 17:20:38 +00:00
..
vcweb vcs-test/vcweb: move init to main 2022-11-03 17:20:38 +00:00
Dockerfile vcs-test: move to GKE 2022-07-20 17:19:35 +00:00
Dockerfile.apache vcs-test: move to GKE 2022-07-20 17:19:35 +00:00
Makefile vcs-test: move to GKE 2022-07-20 17:19:35 +00:00
README.md vcs-test: move to GKE 2022-07-20 17:19:35 +00:00
dav_svn.conf vcs-test: move to GKE 2022-07-20 17:19:35 +00:00
deployment.yaml vcs-test: clean up dead code 2022-08-12 19:07:04 +00:00

README.md

vcs-test

We run a version control server for testing at vcs-test.golang.org.

Repositories

The server can serve Bazaar, Fossil, Git, Mercurial, and Subversion repositories. The root of each repository is https://vcs-test.golang.org/VCS/REPONAME, where VCS is the version control system's command name (bzr for Bazaar, and so on), and REPONAME is the repository name.

To serve a particular repository, the server downloads gs://vcs-test/VCS/REPONAME.zip from Google Cloud Storage and unzips it into an empty directory. The result should be a valid repository directory for the given version control system. If the needed format of the zip file is unclear, download and inspect gs://vcs-test/VCS/hello.zip from https://vcs-test.storage.googleapis.com/VCS/hello.zip.

Google Cloud Storage imposes a default Cache-Control policy of 3600 seconds for publicly-readable objects; for instructions to disable caching per object, see gsutil setmeta. vcweb itself may serve stale data for up to five minutes after a zip file is updated. To force a rescan of Google Cloud Storage, fetch https://vcs-test.golang.org/VCS/REPONAME?vcweb-force-reload=1.

Static files

The URL space https://vcs-test.golang.org/go/NAME is served by static files, fetched from gs://vcs-test/go/NAME.zip. The main use for static files is to write redirect HTML. See gs://vcs-test/go/hello.zip for examples. Note that because the server uses http.DetectContentType to deduce the content type from file data, it is not necessary to name HTML files with a .html suffix.

HTTPS

The server fetches an HTTPS certificate on demand from Let's Encrypt, using golang.org/x/crypto/acme/autocert. It caches the certificates in gs://vcs-test-autocert using golang.org/x/build/autocertcache.