blob: a734f2b3c35162f0597756ec1cc75a522ef5c311 [file] [log] [blame]
Russ Cox1fc394e2017-10-04 15:26:49 -04001#!/bin/bash
2# Copyright 2017 The Go Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style
4# license that can be found in the LICENSE file.
5
6set -e
7
8gcloud compute instances delete vcs-test --zone=us-central1-a
9gcloud compute instances create vcs-test --zone=us-central1-a \
10 --address vcs-test \
11 --image-project debian-cloud --image-family debian-9 \
Alexander Rakoczy922e3542021-10-08 17:03:24 -040012 --machine-type e2-standard-1 \
Russ Cox1fc394e2017-10-04 15:26:49 -040013 --service-account=vcs-test@symbolic-datum-552.iam.gserviceaccount.com \
Filippo Valsorda92cee072018-08-21 12:20:46 -060014 --scopes cloud-platform \
Russ Cox1fc394e2017-10-04 15:26:49 -040015 --tags=allow-ssh,http-server,https-server
16
17while sleep 5 && ! gcloud compute ssh vcs-test -- date; do
18 echo 'waiting for machine to respond to ssh...'
19done
20
21gcloud compute ssh vcs-test -- sudo -n bash -c \''
22 mkdir -p /home/vcweb/svn
23 chown -R uucp:uucp /home/vcweb
Filippo Valsorda92cee072018-08-21 12:20:46 -060024 chmod -R 777 /home/vcweb
Russ Cox1fc394e2017-10-04 15:26:49 -040025 apt-get update
26 apt-get install -y mercurial fossil bzr git apache2 ed subversion libapache2-mod-svn
27 perl -pie 's/80/8888/' /etc/apache2/ports.conf
28 echo "
29 <Location /svn>
30 DAV svn
31 SVNParentPath /home/vcweb/svn
32 <LimitExcept GET PROPFIND OPTIONS REPORT>
33 Require all denied
34 </LimitExcept>
35 </Location>
36 " >/etc/apache2/mods-enabled/dav_svn.conf
37 apache2ctl restart
38 systemctl enable apache2.service
39'\'