Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: go/quicksetup.sh

Issue 2071243002: infra/go: Adding setup instructions and quick setup script. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: cd into the source area. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« go/bootstrap.py ('K') | « go/bootstrap.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/quicksetup.sh
diff --git a/go/quicksetup.sh b/go/quicksetup.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9b3a73fd5c0898033139ec7043352a0e18699842
--- /dev/null
+++ b/go/quicksetup.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+set -eu
+
+mkdir cr-infra-go-area
+cd cr-infra-go-area
+
+# Download depot_tools
+echo "Getting Chromium depot_tools.."
+git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
+echo
+
+echo "Fetching the infra build..."
+export PATH="$PWD/depot_tools:$PATH"
+fetch infra
+
+echo "Creating enter script..."
+# Create a bashrc include file
+ENTER_SCRIPT=$PWD/enter-env.sh
+cat > $ENTER_SCRIPT <<EOF
+#!/bin/bash
+#
+# DO NOT MODIFY, THIS IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN
+#
+[[ "\${BASH_SOURCE[0]}" != "\${0}" ]] && SOURCED=1 || SOURCED=0
+if [ \$SOURCED = 0 ]; then
+ exec bash --init-file $ENTER_SCRIPT
+fi
+
+if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
+
+export PS1
+export DEPOT_TOOLS="$PWD/depot_tools"
+export PATH="\$DEPOT_TOOLS:\$PATH"
+export INFRA_PROMPT_TAG="[cr-infra-go-area] "
+
+cd $PWD/infra/go
+eval \$($PWD/infra/go/env.py)
+
+echo "Entered cr-infra-go-area setup at '$PWD'"
+cd "$PWD/infra/go/src"
+EOF
+
+
+chmod a+x $ENTER_SCRIPT
+
+# Running the env setup for the first time
+source $ENTER_SCRIPT
+
+# Output usage instructions
+echo "--------------------------------------------------------------------"
+echo
+if [ -d ~/bin ]; then
+ BINPATH=~/bin/cr-infra-go-area-enter
+ read -p "Link the enter script to $BINPATH? (y|N) " LINKBIN
+ case "$LINKBIN" in
+ y|Y )
+ ln -sf $ENTER_SCRIPT $BINPATH
+ echo "Enter the environment by running 'cr-infra-go-area-enter'"
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+fi
+echo "Enter the environment by running '$ENTER_SCRIPT'"
« go/bootstrap.py ('K') | « go/bootstrap.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698