Delete gitsync (#2757)
The only remaining project is Tulsi, which has been deprecated for over
three years.
diff --git a/gitsync/Dockerfile b/gitsync/Dockerfile
deleted file mode 100644
index f174843..0000000
--- a/gitsync/Dockerfile
+++ /dev/null
@@ -1,33 +0,0 @@
-FROM ubuntu:18.04
-
-# https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
-RUN apt-get update \
- && apt-get install -y \
- curl \
- git \
- lsb-release \
- openssh-client \
- gnupg2 \
- && export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" \
- && echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list \
- && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
- && apt-get update \
- && apt-get install -y google-cloud-sdk \
- && gcloud config set core/disable_usage_reporting true \
- && gcloud config set component_manager/disable_update_check true \
- && gcloud --version \
- && rm -rf /var/lib/apt/lists/*
-
-RUN useradd --create-home --user-group --shell /bin/bash gitsync
-
-RUN mkdir -p /home/gitsync/.ssh
-COPY ssh_config /home/gitsync/.ssh/config
-COPY known_hosts /home/gitsync/.ssh/known_hosts
-COPY gitsync.sh /home/gitsync/gitsync.sh
-RUN chown -R gitsync:gitsync /home/gitsync
-
-USER gitsync
-RUN git config --global http.cookiefile /home/gitsync/.gitcookies
-
-WORKDIR /home/gitsync
-ENTRYPOINT [ "/home/gitsync/gitsync.sh" ]
diff --git a/gitsync/README.md b/gitsync/README.md
deleted file mode 100644
index 44c1cb9..0000000
--- a/gitsync/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Building the Docker container
-
-```
-$ docker build -t gcr.io/bazel-public/gitsync .
-$ docker push gcr.io/bazel-public/gitsync
-```
-
-# Starting the VM that hosts the Docker container
-
-```
-$ gcloud compute instances delete --project bazel-public gitsync
-$ gcloud compute instances create-with-container \
- --project bazel-public \
- --boot-disk-size 200GB \
- --container-image gcr.io/bazel-public/gitsync:latest \
- --machine-type n1-standard-2 \
- --zone us-central1-a \
- --image-project cos-cloud \
- --image-family cos-stable \
- --metadata cos-metrics-enabled=true \
- --scopes cloud-platform \
- --service-account gitsync@bazel-public.iam.gserviceaccount.com \
- gitsync
-```
-
-# About the service account
-
-The service account used for the container must have at least the following
-permissions:
-
-- `Cloud KMS Decryption` for the gitcookies and SSH key files only.
-- `Logging > Logs Writer` to write the Docker logs to Google Cloud Logging.
-
-# Getting logs from the container
-
-You can view the Docker logs by navigating to the VM in GCE and then by either clicking on "Stackdriver logging" or ssh-ing into the machine and running `docker logs`.
diff --git a/gitsync/gitsync.sh b/gitsync/gitsync.sh
deleted file mode 100755
index 535f1a6..0000000
--- a/gitsync/gitsync.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Scripts to configure the service that will poll git repositories for
-# in sync check.
-
-# Format of each entry is:
-# origin direction destination local-name
-# where
-# direction can be ==> or <=>
-REPOSITORIES=(
- "https://bazel.googlesource.com/tulsi ==> git@github.com:bazelbuild/tulsi.git tulsi upstream"
-)
-
-set -euxo pipefail
-
-# Download & decrypt gitcookies.
-gsutil cat "gs://bazel-trusted-encrypted-secrets/gitsync-cookies.enc" | \
- gcloud kms decrypt --location "global" --keyring "buildkite" --key "gitsync-cookies-key" --plaintext-file "-" --ciphertext-file "-" \
- > /home/gitsync/.gitcookies
-chmod 0600 /home/gitsync/.gitcookies
-
-# Download & decrypt GitHub SSH key.
-gsutil cat "gs://bazel-trusted-encrypted-secrets/gitsync-ssh.enc" | \
- gcloud kms decrypt --location "global" --keyring "buildkite" --key "gitsync-ssh-key" --plaintext-file "-" --ciphertext-file "-" \
- > /home/gitsync/.ssh/id_rsa
-chmod 0600 /home/gitsync/.ssh/id_rsa
-
-function clone() {
- local origin="$1"
- local destination="$3"
- local name="$4"
-
- rm -rf "${name}"
- git clone "${origin}" "${name}"
- pushd "${name}"
- git remote add destination "${destination}"
- popd
-}
-
-function sync() {
- local origin="$1"
- local direction="$2"
- local destination="$3"
- local name="$4"
- local branch="$5"
-
- pushd "${name}"
- echo "Syncing ${origin} ${direction} ${destination} on the $branch branch..."
- git remote update --prune
- git checkout "origin/$branch" -B "$branch"
- if [[ "${direction}" == "<=>" ]]; then
- git rebase "destination/$branch"
- git push -f origin "$branch"
- fi
- git push destination "$branch"
- popd
-}
-
-# Get a local clone
-for i in "${REPOSITORIES[@]}"; do
- clone $i
-done
-
-# Sync loop
-while true; do
- for i in "${REPOSITORIES[@]}"; do
- sync $i
- done
- # Sleep 30 seconds between each sync
- sleep 30
-done
diff --git a/gitsync/known_hosts b/gitsync/known_hosts
deleted file mode 100644
index 31cdb7d..0000000
--- a/gitsync/known_hosts
+++ /dev/null
@@ -1 +0,0 @@
-github.com,192.30.253.112,192.30.253.113 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
diff --git a/gitsync/ssh_config b/gitsync/ssh_config
deleted file mode 100644
index 4db8851..0000000
--- a/gitsync/ssh_config
+++ /dev/null
@@ -1,5 +0,0 @@
-Host github.com
- Hostname github.com
- User git
- IdentityFile /home/gitsync/.ssh/id_rsa
- IdentitiesOnly yes