[fonts] Update to use CIPD prebuilt

This is the start of a soft transition to use the CIPD prebuilt. Once
the change to the ensure file and the noop update script make it to GI,
another change to integration manifest will remove the Jiri hook. After
that, the upload.sh and update.sh scripts will be removed.

Test: Builds locally, CQ
Change-Id: Ib2d761cb4578d0baf673364d8a46df77d2e008d2
diff --git a/bin/fonts/BUILD.gn b/bin/fonts/BUILD.gn
index 2327c54..5b103a9 100644
--- a/bin/fonts/BUILD.gn
+++ b/bin/fonts/BUILD.gn
@@ -190,8 +190,8 @@
   # implemented it will be possible to customize set of fonts on higher levels,
   # which will allow to include these fonts in the default font package.
   fonts = [
-    "notosanscjk/NotoSansCJK-Regular.ttc",
-    "notoserifcjk/NotoSerifCJK-Regular.ttc",
+    "noto-cjk/NotoSansCJK-Regular.ttc",
+    "noto-cjk/NotoSerifCJK-Regular.ttc",
   ]
   foreach (font, fonts) {
     resources += [
diff --git a/bin/fonts/README.md b/bin/fonts/README.md
index b57be0f..14b57a7 100644
--- a/bin/fonts/README.md
+++ b/bin/fonts/README.md
@@ -13,13 +13,9 @@
 ## Adding new fonts.
 To add new fonts:
 
-  1. Create a new directory under `third_party`, e.g. `third_party/fontname`.
-  2. Place all font files in the new directory along with LICENSE and README files.
-  3. Run `./upload.sh third_party/fontname` to package and upload the archive to
-     Google Storage. The upload step will fail if you don't have upload
-     permission for the `fuchsia-build` storage bucket, in which case you will
-     need to file infra (INTK-) ticket to be added to the ACL.
-  4. Run `git add third_party/fontname.stamp` to add the `.stamp` file created
-     created by `upload.sh`.
+  1. Place all font files in the new directory along with LICENSE and README files.
+  2. Add the relevant repository and font files to the recipe [here](https://fuchsia.googlesource.com/infra/recipes/+/master/recipes/fonts.py).
+  3. Update the Fonts section of the CIPD ensure file [here](https://fuchsia.googlesource.com/garnet/+/master/tools/cipd.ensure) with the new git_revisions (which can be retrieved from [here](https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/fonts/+/)).
+  4. Trigger the bot to run with the changes from the LUCI scheduler [here](https://luci-scheduler.appspot.com/jobs/fuchsia/fonts).
   5. Add the new font files in `BUILD.gn`.
   6. Add the new fonts in `manifest.json`.
diff --git a/bin/fonts/third_party/.gitignore b/bin/fonts/third_party/.gitignore
index ae4726e..f59ec20 100644
--- a/bin/fonts/third_party/.gitignore
+++ b/bin/fonts/third_party/.gitignore
@@ -1,2 +1 @@
-/*/
-/*.stamp
+*
\ No newline at end of file
diff --git a/bin/fonts/third_party/material.version b/bin/fonts/third_party/material.version
deleted file mode 100644
index 83bc7d2..0000000
--- a/bin/fonts/third_party/material.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/flutter_infra/flutter/fonts/13ac995daa9dda0a6ba0a45f1fccc541e616a74c/fonts.zip
diff --git a/bin/fonts/third_party/notosanscjk.version b/bin/fonts/third_party/notosanscjk.version
deleted file mode 100644
index 0fe8575..0000000
--- a/bin/fonts/third_party/notosanscjk.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/fuchsia-build/fuchsia/fonts/notosanscjk/c3eab809336dc3758db8c9a458ab9f4fff6dac4d
diff --git a/bin/fonts/third_party/notoserifcjk.version b/bin/fonts/third_party/notoserifcjk.version
deleted file mode 100644
index 5f4cd9f..0000000
--- a/bin/fonts/third_party/notoserifcjk.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/fuchsia-build/fuchsia/fonts/notoserifcjk/aebdd458b648712e424be4679f7321a3f2b0a1c1
diff --git a/bin/fonts/third_party/roboto.version b/bin/fonts/third_party/roboto.version
deleted file mode 100644
index a892280..0000000
--- a/bin/fonts/third_party/roboto.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/fuchsia-build/fuchsia/fonts/roboto/2b3182821a3db0d51f98246488e10d8a7c7124f5
diff --git a/bin/fonts/third_party/robotocondensed.version b/bin/fonts/third_party/robotocondensed.version
deleted file mode 100644
index e177bb8..0000000
--- a/bin/fonts/third_party/robotocondensed.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/fuchsia-build/fuchsia/fonts/robotocondensed/ac018636489bb28e91cd78b12045bad6db81d515
diff --git a/bin/fonts/third_party/robotomono.version b/bin/fonts/third_party/robotomono.version
deleted file mode 100644
index 4598e59..0000000
--- a/bin/fonts/third_party/robotomono.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/fuchsia-build/fuchsia/fonts/robotomono/1b35ee98c9006924aae9c4892dda971f66c88180
diff --git a/bin/fonts/third_party/robotoslab.version b/bin/fonts/third_party/robotoslab.version
deleted file mode 100644
index 12a92e7..0000000
--- a/bin/fonts/third_party/robotoslab.version
+++ /dev/null
@@ -1 +0,0 @@
-https://storage.googleapis.com/fuchsia-build/fuchsia/fonts/robotoslab/d5683b5087419cfbfe8a1a80106a299b8fde249b
diff --git a/bin/fonts/update.sh b/bin/fonts/update.sh
index 40ba15e..514daac 100755
--- a/bin/fonts/update.sh
+++ b/bin/fonts/update.sh
@@ -5,65 +5,4 @@
 
 set -eu
 
-readonly SCRIPT_ROOT="$(cd $(dirname ${BASH_SOURCE[0]} ) && pwd)"
-
-# download <url> <path>
-function download() {
-  local url="${1}"
-  local path="${2}"
-  curl -f --progress-bar -continue-at=- --location --output "${path}" "${url}"
-}
-
-# download_file_if_needed <name> <base path> <extension>
-function download_file_if_needed() {
-  local name="${1}"
-  local base_path="${2}"
-  local extension="${3}"
-
-  local path="${base_path}.${extension}"
-  local stamp_path="${base_path}.stamp"
-  local requested_url="$(cat "${base_path}.version")"
-
-  if [[ ! -f "${stamp_path}" ]] || [[ "${requested_url}" != "$(cat "${stamp_path}")" ]]; then
-    echo "Downloading ${name}..."
-    rm -f -- "${path}"
-    download "${requested_url}" "${path}"
-    echo "${requested_url}" > "${stamp_path}"
-  fi
-}
-
-# download_tarball <name> <base url> <untar directory> <extension>
-function download_tarball() {
-  local name="${1}"
-  local base_url="${2}"
-  local untar_dir="${SCRIPT_ROOT}/${3}"
-  local extension="${4}"
-  local tar_path="${untar_dir}.${extension}"
-
-  download_file_if_needed "${name}" "${untar_dir}" "${extension}"
-  case "x${extension}" in
-    xtar*) local extract_cmd="tar xf" ;;
-    xzip) local extract_cmd="unzip" ;;
-    *) echo "unknown archive type" && exit -1 ;;
-  esac
-  if [[ -f "${tar_path}" ]]; then
-    mkdir -p -- "${untar_dir}"
-    (cd -- "${untar_dir}" && ${extract_cmd} "${tar_path}")
-    rm -f -- "${tar_path}"
-  fi
-}
-
-# download_font <name> <extract>
-function download_font() {
-  local name="${1}"
-  local extension="${2}"
-  download_tarball "${name}" "fonts/${name}" "third_party/${name}" "${extension}"
-}
-
-download_font material zip
-download_font roboto tar.bz2
-download_font robotocondensed tar.bz2
-download_font robotomono tar.bz2
-download_font robotoslab tar.bz2
-download_font notosanscjk tar.bz2
-download_font notoserifcjk tar.bz2
+# Deleted for soft transition to cipd prebuilts. 
diff --git a/tools/cipd.ensure b/tools/cipd.ensure
index 7babc47..8155e0b 100644
--- a/tools/cipd.ensure
+++ b/tools/cipd.ensure
@@ -19,3 +19,7 @@
 # Prebuilt ffmpeg library.
 @Subdir lib/media/ffmpeg/prebuilt
 fuchsia/lib/ffmpeg/fuchsia git_revision:18571e04d02a0bce3df3dabf8dbeb472c3023c16
+
+# Fonts
+@Subdir bin/fonts/third_party
+fuchsia/third_party/fonts git_revision:94dff3eaa9301b6640cccc63c56d6ff33d82882c,224895a86501195e7a7ff3dde18e39f00b8e3d5a,9326451d9b4f32ec7f8640581c5053cc192039f2