• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15PROJECT="perfetto-ci"
16VM_NAME="perfetto-ci-git-mirror-bot"
17ZONE="us-central1-c"
18
19ssh:
20	gcloud --account $(USER)@google.com \
21		compute --project $(PROJECT) ssh --zone $(ZONE) gitbot@$(VM_NAME)
22
23stop:
24	gcloud compute \
25		--project $(PROJECT) \
26		instances delete $(VM_NAME) \
27		--zone $(ZONE)
28
29deploy_key:
30	@echo "Download the deploy_key from the teams drive (go/perfetto_deploy_key)"
31	@exit 1
32
33start: deploy_key
34	gcloud compute \
35		--project $(PROJECT) \
36		instances create $(VM_NAME) \
37		--zone $(ZONE) \
38		--machine-type "f1-micro" \
39		--subnet "default" \
40		--maintenance-policy "MIGRATE" \
41		--image "debian-9-stretch-v20170918" \
42		--image-project "debian-cloud" \
43		--boot-disk-size "10" \
44		--boot-disk-type "pd-standard" \
45		--boot-disk-device-name "perfetto-ci-git-mirror-bot" \
46		--metadata-from-file=startup-script=startup-script.sh,deploy_key=deploy_key,main=mirror_aosp_to_ghub_repo.py
47
48.PHONY: ssh stop start
49