From 49477f2426ce9c08314bc765148868f86f548ef0 Mon Sep 17 00:00:00 2001 From: Ben Kraft Date: Fri, 25 May 2018 15:36:00 -0700 Subject: [PATCH] Automatically set up arcrc if it's missing Summary: Right now the instructions tell you to do it manually. But we can just do it for you! (Well, you'll have to do what it says, but at least you don't have to be instructed to run the command.) Depends on D45131 for this command to be sufficient. Test Plan: `rm ~/.arcrc /tmp/arc.pull` then `./setup.sh` should set up a new arcrc (with my help); running again should no-op. Reviewers: csilvers, jacqueline Reviewed By: csilvers Subscribers: #devops Differential Revision: https://phabricator.khanacademy.org/D45132 --- setup.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 962cf03..f1d2a87 100755 --- a/setup.sh +++ b/setup.sh @@ -330,6 +330,24 @@ install_hooks() { fi } +# Set up .arcrc: we can't update this through the standard process +# because it has secrets embedded in it, but our arcanist fork will +# do the updates for us. +setup_arc() { + if [ ! -f "$HOME/.arcrc" ]; then + echo "Time to set up arc to talk to Phabricator!" + echo "First, go make sure you're logged in and your" + echo "account is set up (use Google OAuth to create" + echo "an account, if you haven't). Click here to start:" + echo " --> https://phabricator.khanacademy.org <--" + echo -n "Press enter when you're logged in: " + read + # This is added to PATh by dotfiles, but those may not be sourced yet. + PATH="$DEVTOOLS_DIR/arcanist/khan-bin:$PATH" + arc install-certificate https://phabricator.khanacademy.org + fi +} + check_dependencies @@ -344,9 +362,10 @@ edit_system_config # the order for these is (mostly!) important, beware clone_repos install_and_setup_gcloud -install_deps # pre-req: clone_repos, install_and_setup_gcloud +install_deps # pre-reqs: clone_repos, install_and_setup_gcloud install_hooks # pre-req: clone_repos -download_db_dump # pre-reqs: install_deps +setup_arc # pre-req: clone_repos +download_db_dump # pre-req: install_deps echo