Skip to content

Commit

Permalink
Automatically set up arcrc if it's missing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
benjaminjkraft committed May 25, 2018
1 parent 2f2a611 commit 49477f2
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 49477f2

Please sign in to comment.