~launchpad-pqm/launchpad/devel

4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
1
#! /bin/bash
8452.3.3 by Karl Fogel
* utilities/: Add copyright header block to source files that were
2
#
12042.1.2 by Aaron Bentley
Move rocketfuel-env.sh closer to its use.
3
# Copyright 2009, 2010 Canonical Ltd.  This software is licensed under the
8687.15.3 by Karl Fogel
Shorten the copyright header block to two lines.
4
# GNU Affero General Public License version 3 (see the file LICENSE).
8452.3.3 by Karl Fogel
* utilities/: Add copyright header block to source files that were
5
#
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
6
# This script will set up a brand new Ubuntu machine as a LP developer
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
7
# workstation, from scratch. The script lives in the LP codebase itself,
8
# as utilities/rocketfuel-setup
9
10
# load up Ubuntu release details so we know which repos to enable
11
source /etc/lsb-release
12042.1.3 by Aaron Bentley
Skip local branch configuration if --no-workspace supplied.
12
DO_WORKSPACE=1
13
for arg in "$@"; do
14
  if [ "$arg" == "--no-workspace" ]; then
15
    DO_WORKSPACE=0
16
  else
17
    echo Unrecognized argument: $arg >& 2
18
    exit 1;
19
  fi
20
done
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
21
8486.13.2 by Curtis Hovey
Merge from launchpad devel. Reconciled devpad removals.
22
# Establish LP username
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
23
whoami=`whoami`
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
24
printf "What is your Launchpad username? [$whoami] "
25
read lpusername
26
if [ -z ${lpusername} ]; then
27
  lpusername=${whoami}
28
fi
29
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
30
# Make sure you have all the needed virtual hosts
31
32
dev_host() {
6979.1.5 by Curtis Hovey
Added id.launchpad.net to /etc/hosts. Updated the matching rules to check for the
33
  grep -q "^127.0.0.88.* ${hostname}" /etc/hosts
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
34
  if [ $? -ne 0 ]; then
35
    sudo sed -i "s/^127.0.0.88.*$/&\ ${hostname}/" /etc/hosts
36
    echo "${hostname} added to /etc/hosts"
37
  fi
38
  }
39
40
grep -q "^127.0.0.88" /etc/hosts
41
if [ $? -ne 0 ]; then
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
42
  echo "Adding development hosts on local machine"
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
43
  echo "
44
# Launchpad virtual domains. This should be on one line.
45
127.0.0.88      launchpad.dev
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
46
" | sudo tee -a /etc/hosts > /dev/null
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
47
  echo "launchpad.dev added to /etc/hosts"
48
fi
49
6673.1.5 by Barry Warsaw
Respond to Edwin's review.
50
declare -a hostnames
51
hostnames=$(cat <<EOF
52
    answers.launchpad.dev
10053.1.1 by William Grant
Create archive.launchpad.dev, to which the local primary/partner archives are published.
53
    archive.launchpad.dev
6673.1.5 by Barry Warsaw
Respond to Edwin's review.
54
    api.launchpad.dev
7459.5.21 by Michael Hudson
make security considerations much more obvious
55
    bazaar-internal.launchpad.dev
6673.1.5 by Barry Warsaw
Respond to Edwin's review.
56
    beta.launchpad.dev
57
    blueprints.launchpad.dev
58
    bugs.launchpad.dev
59
    code.launchpad.dev
60
    feeds.launchpad.dev
6979.1.5 by Curtis Hovey
Added id.launchpad.net to /etc/hosts. Updated the matching rules to check for the
61
    id.launchpad.dev
8971.11.1 by William Grant
Add PPA and keyserver hostnames to /etc/hosts.
62
    keyserver.launchpad.dev
8687.11.1 by Karl Fogel
* utilities/rocketfuel-setup
63
    lists.launchpad.dev
6673.1.5 by Barry Warsaw
Respond to Edwin's review.
64
    openid.launchpad.dev
7675.346.1 by James Henstridge
Add central config changes to support second OpenID provider vhost.
65
    ubuntu-openid.launchpad.dev
8971.11.1 by William Grant
Add PPA and keyserver hostnames to /etc/hosts.
66
    ppa.launchpad.dev
67
    private-ppa.launchpad.dev
10212.5.9 by Guilherme Salgado
Rename the vhost used for the test OpenID provider to testopenid.dev
68
    testopenid.dev
6673.1.5 by Barry Warsaw
Respond to Edwin's review.
69
    translations.launchpad.dev
70
    xmlrpc-private.launchpad.dev
71
    xmlrpc.launchpad.dev
72
EOF
73
    )
74
75
for hostname in $hostnames; do
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
76
  dev_host;
77
done
78
7551.3.11 by Michael Hudson
reasonably foul (but working!) apache config
79
grep -q "^127.0.0.99" /etc/hosts
80
if [ $? -ne 0 ]; then
81
  echo "
82
127.0.0.99      bazaar.launchpad.dev
83
" | sudo tee -a /etc/hosts > /dev/null
84
  echo "bazaar.launchpad.dev added to /etc/hosts"
85
fi
86
11128.10.2 by Michael Hudson
merge more separate apache config from later pipe
87
grep -q "^127.0.0.77" /etc/hosts
88
if [ $? -ne 0 ]; then
89
  echo "
90
127.0.0.77      vostok.dev archive.vostok.dev
91
" | sudo tee -a /etc/hosts > /dev/null
92
  echo "vostok.dev added to /etc/hosts"
93
fi
94
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
95
# Enable relevant Ubuntu package repositories
96
grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list
97
if [ $? -ne 0 ]; then
98
    echo "Please enable the 'universe' component in /etc/apt/source.list'"
99
    exit 1
100
fi
101
grep -q "^deb http:.* ${DISTRIB_CODENAME} .*multiverse" /etc/apt/sources.list
102
if [ $? -ne 0 ]; then
103
    echo "Please enable the 'multiverse' component in /etc/apt/source.list'"
104
    exit 1
105
fi
106
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
107
LPDEV_SOURCES="/etc/apt/sources.list.d/launchpad-dev.list"
108
if [ ! -e $LPDEV_SOURCES ]; then
109
  sudo touch $LPDEV_SOURCES
110
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
111
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
112
LP_PPA="deb http://ppa.launchpad.net/launchpad/ppa/ubuntu ${DISTRIB_CODENAME} main"
113
grep -q "^${LP_PPA}" $LPDEV_SOURCES
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
114
if [ $? -ne 0 ]; then
7693.1.3 by Brad Crittenden
Changes due to review
115
  echo "Adding ~launchpad PPA repository to package source list."
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
116
  echo "$LP_PPA"  | sudo tee -a $LPDEV_SOURCES
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
117
fi
118
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
119
BZR_PPA="deb http://ppa.launchpad.net/bzr/ppa/ubuntu ${DISTRIB_CODENAME} main"
120
grep -q "^${BZR_PPA}" $LPDEV_SOURCES
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
121
if [ $? -ne 0 ]; then
7693.1.3 by Brad Crittenden
Changes due to review
122
  echo "Adding ~bzr PPA repository to package source list."
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
123
  echo "$BZR_PPA" | sudo tee -a $LPDEV_SOURCES
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
124
fi
125
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
126
# Get the key used to sign the launchpad-developer-dependencies in the PPA.
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
127
REQUIRED_PPA_KEYS="0A5174AF 8C6C1EFD"
7598.6.4 by Brad Crittenden
Added bzr PPA key and brought up-to-date with new apache local-launchpad settings.
128
for key in $REQUIRED_PPA_KEYS; do
129
   sudo apt-key list | grep -q $key
130
   if [ $? -ne 0 ]; then
131
     echo "Retrieving key $key."
13085.1.1 by Deryck Hodge
Update the keyserver URL based on Sorin Sbârnea's suggestion
132
     gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $key
7598.6.4 by Brad Crittenden
Added bzr PPA key and brought up-to-date with new apache local-launchpad settings.
133
     if [ $? -ne 0 ]; then
134
       echo "Could not retrieve key $key."
135
       exit 1
136
     fi
137
     gpg --export -a $key | sudo apt-key add -
138
     if [ $? -ne 0 ]; then
139
       echo "Could not install key $key."
140
       exit 1
141
     fi
142
   fi
143
done
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
144
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
145
do_install() {
7693.1.3 by Brad Crittenden
Changes due to review
146
  dpkg -s $pkg | grep -q "^Status: install ok installed"
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
147
  if [ $? -ne 0 ]; then
148
    echo "Installing $pkg package..."
11573.2.1 by Brad Crittenden
aptitude is not installed by default in maverick so use apt-get instead.
149
    sudo apt-get install $pkg
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
150
    if [ $? -ne 0 ]; then
151
      echo "Unable to install $pkg."
152
      exit 1
153
    fi
154
  fi
155
  }
156
11573.2.1 by Brad Crittenden
aptitude is not installed by default in maverick so use apt-get instead.
157
sudo apt-get update
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
158
REQUIRED_PACKAGES="launchpad-developer-dependencies apache2 apache2-mpm-worker"
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
159
for pkg in $REQUIRED_PACKAGES; do
160
  do_install;
161
done
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
162
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
163
# Create the document root(s) to avoid Apache warnings
7598.6.4 by Brad Crittenden
Added bzr PPA key and brought up-to-date with new apache local-launchpad settings.
164
mkdir -p /var/tmp/bazaar.launchpad.dev/static
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
165
mkdir -p /var/tmp/bazaar.launchpad.dev/mirrors
4706.2.19 by Jonathan Lange
Make the mirrors directory in rocketfuel-setup.
166
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
167
sudo a2enmod proxy > /dev/null
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
168
if [ $? -ne 0 ]; then
169
  echo "ERROR: Unable to enable proxy module in Apache2"
170
  exit 1
171
fi
172
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
173
sudo a2enmod proxy_http > /dev/null
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
174
if [ $? -ne 0 ]; then
175
  echo "ERROR: Unable to enable proxy_http module in Apache2"
176
  exit 1
177
fi
178
4706.2.9 by Jonathan Lange
Update the documentation and add bazaar.launchpad.dev setup to rocketfuel-setup.
179
sudo a2enmod rewrite > /dev/null
180
if [ $? -ne 0 ]; then
181
  echo "ERROR: Unable to enable rewrite module in Apache2"
182
  exit 1
183
fi
184
6991.1.1 by Guilherme Salgado
Serve *.launchpad.dev through https
185
sudo a2enmod ssl > /dev/null
186
if [ $? -ne 0 ]; then
187
  echo "ERROR: Unable to enable ssl module in Apache2"
188
  exit 1
189
fi
190
7140.7.2 by Celso Providelo
Adjust rocketfuel-setup and development apache configuration to use mod_deflate.
191
sudo a2enmod deflate > /dev/null
192
if [ $? -ne 0 ]; then
193
  echo "ERROR: Unable to enable deflate module in Apache2"
194
  exit 1
195
fi
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
196
7598.6.4 by Brad Crittenden
Added bzr PPA key and brought up-to-date with new apache local-launchpad settings.
197
sudo a2enmod headers > /dev/null
198
if [ $? -ne 0 ]; then
199
  echo "ERROR: Unable to enable headers module in Apache2"
200
  exit 1
201
fi
202
12042.1.3 by Aaron Bentley
Skip local branch configuration if --no-workspace supplied.
203
if [ $DO_WORKSPACE == 0 ]; then
204
  cat <<EOT
205
Branches have not been created, as requested.  You will need to do some or all
206
of the following steps:
207
$ bzr branch lp:launchpad devel
208
$ cd devel
209
$ bzr branch lp:~launchpad/lp-source-dependencies/trunk/ download-cache
210
$ utilities/update-sourcecode
211
$ utilities/launchpad-database-setup
212
$ make schema
213
$ sudo make install
214
EOT
215
  exit 0
216
fi
217
12042.1.2 by Aaron Bentley
Move rocketfuel-env.sh closer to its use.
218
if [ ! -e "$HOME/.rocketfuel-env.sh" ]; then
219
  echo "# Common environment variables for the rocketfuel-* scripts.
220
#
221
# The ones you can set are:
222
#
223
# LP_PROJECT_ROOT - The root directory of all your Launchpad stuff.  Your
224
#                   Launchpad shared repository will live in a child directory
225
#                   of this directory.
226
# LP_SHARED_REPO  - Your Launchpad shared repository directory.  All of your
227
#                   Launchpad development branches will live under here.
228
# LP_TRUNK_NAME   - The directory name (not path!) to your rocketfuel trunk
229
#                   mirror directory.  This is relative to your shared repo.
230
# LP_SOURCEDEPS_DIR - The name of the directory (not path!) where your
231
#                   trunk sourcecode will be placed.  This is relative to your
232
#                   LP_PROJECT_ROOT and should /not/ have the 'sourcecode'
233
#                   path appended to it, since this is automatically added by
234
#                   the scripts.
235
236
LP_PROJECT_ROOT=\${LP_PROJECT_ROOT:=~/launchpad}
237
LP_SHARED_REPO=\${LP_SHARED_REPO:=lp-branches}
238
LP_PROJECT_PATH=\$LP_PROJECT_ROOT/\$LP_SHARED_REPO
239
LP_TRUNK_NAME=\${LP_TRUNK_NAME:=devel}
240
LP_TRUNK_PATH=\$LP_PROJECT_PATH/\$LP_TRUNK_NAME
241
242
LP_SOURCEDEPS_DIR=\${LP_SOURCEDEPS_DIR:=lp-sourcedeps}
243
LP_SOURCEDEPS_PATH=\$LP_PROJECT_ROOT/\$LP_SOURCEDEPS_DIR/sourcecode
244
245
# Force tilde expansion
246
LP_SOURCEDEPS_PATH=\$(eval echo \${LP_SOURCEDEPS_PATH})
247
" > "$HOME/.rocketfuel-env.sh"
248
fi
249
250
source "$HOME/.rocketfuel-env.sh"
251
if [ "$?" != 0 ]; then
252
    echo "Something went wrong with rocketfuel-setup!"
253
    exit 1
254
fi
255
256
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
257
# Create the local branch structure we will use for managing Launchpad code
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
258
mkdir -p $LP_PROJECT_ROOT
259
cd $LP_PROJECT_ROOT
6567.2.2 by Barry Warsaw
Respond to review comments.
260
if [ ! -d $LP_SHARED_REPO ]; then
8687.14.1 by Karl Fogel
In rocketfuel-setup, pass '--2a' instead of '--1.6' to 'bzr init-repo'.
261
  # 2a format (a.k.a. "brisbane-core") needed for stacking on Launchpad.
262
  bzr init-repo --2a $LP_SHARED_REPO
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
263
  if [ $? -ne 0 ]; then
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
264
    echo "ERROR: Unable to set up local LP repository"
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
265
    exit 1
266
  fi
267
fi
6567.2.2 by Barry Warsaw
Respond to review comments.
268
if [ ! -d $LP_SHARED_REPO/.bzr -a -d $LP_SHARED_REPO/.bzr/repository ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
269
  echo "ERROR: LP repository not found in $LP_PROJECT_PATH"
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
270
  exit 1
271
fi
272
8931.1.5 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user that a certain bzr warning
273
echo "Logging bzr into Launchpad (it's okay if this errors)..."
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
274
bzr launchpad-login $lpusername
8931.1.5 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user that a certain bzr warning
275
if [ $? -ne 0 ]; then
276
  echo ""
277
  echo "You can ignore any error above about not registering an SSH key"
278
  echo "with Launchpad.  Registering an SSH key is only important if you"
279
  echo "are writing data to Launchpad, or trying to access private data."
280
  echo ""
281
fi
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
282
6567.2.2 by Barry Warsaw
Respond to review comments.
283
cd $LP_SHARED_REPO
6567.1.4 by Barry Warsaw
Last minute patch and whitespace normalization.
284
if [ ! -d $LP_TRUNK_NAME ]; then
285
  echo "Making local branch of Launchpad trunk, this may take a while..."
9647.2.1 by Michael Hudson
use bzr+ssh rather than http in rocketfuel-setup
286
  bzr branch lp:~launchpad-pqm/launchpad/devel $LP_TRUNK_NAME
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
287
  if [ $? -ne 0 ]; then
288
    echo "ERROR: Unable to create local copy of Rocketfuel trunk"
289
    exit 1
290
  fi
291
fi
292
6567.1.4 by Barry Warsaw
Last minute patch and whitespace normalization.
293
cd $LP_TRUNK_NAME
9322.4.1 by Simon Olofsson
Fixes: bug 402187: rocketfuel-setup can't resume if fails to complete
294
bzr st -q
295
if [ $? -ne 0 ]; then
296
  echo "ERROR: Your trunk branch in $LP_TRUNK_PATH is corrupted.
297
       Please delete $LP_TRUNK_PATH and run rocketfuel-setup again."
298
       exit 1
299
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
300
if [ ! `bzr info | grep -i "parent branch" | cut -d: -f3` = \
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
301
  "//bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/" ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
302
  echo "ERROR: Your trunk branch in $LP_TRUNK_PATH has an
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
303
       incorrect pull location, correcting now..."
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
304
  bzr pull --remember bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel/
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
305
  if [ $? -ne 0 ]; then
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
306
    echo "ERROR: Unable to set trunk pull location to lp:~launchpad-pqm/launchpad/devel/"
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
307
    exit 1
308
  fi
309
fi
310
9948.1.1 by Maris Fogels
Make the apache process restart after installing the new configuration and modules, to prevent the new modules from segfaulting because of bugs.
311
# Call the newly minted Launchpad branch's 'make install' target to do some
312
# more apache setup.
5543.3.2 by Tim Penhey
Alterations to the way codebrowse is started, and updating rocketfuel-setup
313
sudo make install > /dev/null
314
if [ $? -ne 0 ]; then
315
  echo "ERROR: Unable to install apache config appropriately"
316
  exit 1
317
fi
318
319
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
320
# Set up Bazaar locations configuration
4958.2.3 by Mark Shuttleworth
Make rf-setup create ~/.bazaar if needed
321
if [ ! -d ~/.bazaar ]; then
322
  mkdir ~/.bazaar
323
  if [ $? -ne 0 ]; then
324
    echo "Unable to create ~/.bazaar/ directory"
325
    exit 1
326
  fi
327
fi
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
328
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
329
if [ ! -e ~/.bazaar/locations.conf ]; then
330
  touch ~/.bazaar/locations.conf
331
fi
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
332
6666.1.2 by Brad Crittenden
Simplified the setting for locations.conf
333
grep -q "\[${LP_PROJECT_PATH}\]" ~/.bazaar/locations.conf
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
334
if [ $? -ne 0 ]; then
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
335
  cat >> ~/.bazaar/locations.conf << EOF
6666.1.2 by Brad Crittenden
Simplified the setting for locations.conf
336
[$LP_PROJECT_PATH]
6666.1.1 by Brad Crittenden
Changes to locations.conf to match RocketFuelSetupDetails
337
submit_branch = ${LP_TRUNK_PATH}
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
338
public_branch = bzr+ssh://bazaar.launchpad.net/~${lpusername}/launchpad
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
339
public_branch:policy = appendpath
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
340
push_location = lp:~${lpusername}/launchpad
4317.1.6 by Mark Shuttleworth
Make sure new stanza in ~/.bazaar/locations.conf starts on its own line
341
push_location:policy = appendpath
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
342
merge_target = ${LP_TRUNK_PATH}
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
343
submit_to = merge@code.launchpad.net
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
344
EOF
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
345
6666.1.1 by Brad Crittenden
Changes to locations.conf to match RocketFuelSetupDetails
346
grep -q "\[$LP_TRUNK_PATH\]" ~/.bazaar/locations.conf
347
if [ $? -ne 0 ]; then
348
  echo "
349
[$LP_TRUNK_PATH]
7598.6.6 by Brad Crittenden
Fixed location of public_branch
350
public_branch = bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel\
6666.1.1 by Brad Crittenden
Changes to locations.conf to match RocketFuelSetupDetails
351
" | tee -a ~/.bazaar/locations.conf > /dev/null
352
fi
353
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
354
echo "Bazaar branch configuration updated."
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
355
356
fi
357
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
358
# Set up scripts in /usr/local/bin
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
359
cd /usr/local/bin
360
if [ ! -e rocketfuel-get ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
361
  sudo ln -s $LP_TRUNK_PATH/utilities/rocketfuel-get
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
362
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
363
ls -l rocketfuel-get | cut -d">" -f2 | grep -q "$LP_TRUNK_NAME\/utilities\/rocketfuel"
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
364
if [ $? -ne 0 ]; then
365
  echo "WARNING: /usr/local/bin/rocketfuel-get should be deleted so I can
366
         recreate it."
367
fi
5323.2.1 by Mark Shuttleworth
Manage featured projects in the db
368
if [ ! -e rocketfuel-flakes ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
369
  sudo ln -s $LP_TRUNK_PATH/utilities/rocketfuel-flakes
5323.2.1 by Mark Shuttleworth
Manage featured projects in the db
370
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
371
ls -l rocketfuel-flakes | cut -d">" -f2 | grep -q "$LP_TRUNK_NAME\/utilities\/rocketfuel"
5323.2.1 by Mark Shuttleworth
Manage featured projects in the db
372
if [ $? -ne 0 ]; then
373
  echo "WARNING: /usr/local/bin/rocketfuel-flakes should be deleted so I can
374
         recreate it."
375
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
376
if [ ! -e rocketfuel-branch ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
377
  sudo ln -s $LP_TRUNK_PATH/utilities/rocketfuel-branch
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
378
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
379
ls -l rocketfuel-branch | cut -d">" -f2 | grep -q "$LP_TRUNK_NAME\/utilities\/rocketfuel"
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
380
if [ $? -ne 0 ]; then
381
  echo "WARNING: /usr/local/bin/rocketfuel-branch should be deleted so I can
382
         recreate it."
383
fi
384
if [ ! -e rocketfuel-setup ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
385
  sudo ln -s $LP_TRUNK_PATH/utilities/rocketfuel-setup
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
386
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
387
ls -l rocketfuel-setup | cut -d">" -f2 | grep -q "$LP_TRUNK_NAME\/utilities\/rocketfuel"
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
388
if [ $? -ne 0 ]; then
389
  echo "WARNING: /usr/local/bin/rocketfuel-setup should be deleted so I can
390
         recreate it."
391
fi
4343.1.3 by Mark Shuttleworth
Add symlink for rocketfuel-status
392
if [ ! -e rocketfuel-status ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
393
  sudo ln -s $LP_TRUNK_PATH/utilities/rocketfuel-status
4343.1.3 by Mark Shuttleworth
Add symlink for rocketfuel-status
394
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
395
ls -l rocketfuel-status | cut -d">" -f2 | grep -q "$LP_TRUNK_NAME\/utilities\/rocketfuel"
4343.1.3 by Mark Shuttleworth
Add symlink for rocketfuel-status
396
if [ $? -ne 0 ]; then
397
  echo "WARNING: /usr/local/bin/rocketfuel-status should be deleted so I can
398
         recreate it."
399
fi
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
400
if [ ! -e rocketfuel-push ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
401
  sudo ln -s $LP_TRUNK_PATH/utilities/rocketfuel-push
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
402
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
403
ls -l rocketfuel-push | cut -d">" -f2 | grep -q "$LP_TRUNK_NAME\/utilities\/rocketfuel"
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
404
if [ $? -ne 0 ]; then
405
  echo "WARNING: /usr/local/bin/rocketfuel-push should be deleted so I can
406
         recreate it."
407
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
408
409
410
# Make sure we have all the right code in place for source dependencies
411
/usr/local/bin/rocketfuel-get
412
4317.1.5 by Mark Shuttleworth
Also setup ssh access to bazaar.launchpad.dev
413
echo "
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
414
Thank you for using this script.  You can improve it for everyone by
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
415
committing changes to Launchpad in utilities/rocketfuel-setup.
4317.1.5 by Mark Shuttleworth
Also setup ssh access to bazaar.launchpad.dev
416
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
417
Please see http://dev.launchpad.net/ for more information on
418
developing and testing Launchpad, and on submitting changes.
7426.1.2 by Julian Edwards
remove the canonical smtp server pssword and direct the user to where to find it.
419
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
420
You can use the following commands to manage your Launchpad
421
development environment:
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
422
423
 rocketfuel-get
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
424
    Update your copy of $LP_TRUNK_NAME and the necessary source
425
    dependencies, and make sure all source dependencies are properly
426
    linked in to all the branches you are working on.
6567.1.3 by Barry Warsaw
parameterize all paths so that launchpad code can live anywhere.
427
428
 rocketfuel-branch foo
8234.1.7 by Gary Poster
rocketfuel scripts and download cache are in place now.
429
    Create a new branch of LP called \"foo\" in
430
    $LP_PROJECT_PATH/foo,
6567.1.3 by Barry Warsaw
parameterize all paths so that launchpad code can live anywhere.
431
    with all the source dependencies properly linked in.
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
432
433
 rocketfuel-status
8234.1.7 by Gary Poster
rocketfuel scripts and download cache are in place now.
434
    Check each of the branches in $LP_PROJECT_PATH
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
435
    and show which of them have uncommitted changes; also check which ones
8234.1.7 by Gary Poster
rocketfuel scripts and download cache are in place now.
436
    have revisions that have not yet landed on trunk.
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
437
438
 rocketfuel-push
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
439
    Push all of your branches to Launchpad, so that you have a server-side
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
440
    backup of everything.
4317.1.5 by Mark Shuttleworth
Also setup ssh access to bazaar.launchpad.dev
441
442
Happy hacking!
443
"