provision: Use a more efficient approach for getting yarn version.

Since yarn has a package.json conveniently available, we can parse
that with jq, saving the expensive operation of starting up yarn.

This saves ~300ms in a no-op provision.
This commit is contained in:
Tim Abbott
2018-12-07 14:28:04 -08:00
parent a1ca8c262a
commit 630968b632
3 changed files with 14 additions and 3 deletions

View File

@@ -37,6 +37,12 @@ VENV_DEPENDENCIES = [
"libxslt1-dev", # Used for installing talon
"libpq-dev", # Needed by psycopg2
"libssl-dev", # Needed to build pycurl and other libraries
# This is technically a node dependency, but we add it here
# because we don't have another place that we install apt packages
# on upgrade of a production server, and it's not worth adding
# another call to `apt install` for.
"jq", # Used by scripts/lib/install-node to check yarn version
]
codename = parse_lsb_release()["DISTRIB_CODENAME"]