~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
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
87
# Enable relevant Ubuntu package repositories
88
grep -q "^deb http:.* ${DISTRIB_CODENAME} .*universe" /etc/apt/sources.list
89
if [ $? -ne 0 ]; then
13341.1.1 by Bryce Harrington
Fix typo in message referring to /etc/apt/sources.list
90
    echo "Please enable the 'universe' component in /etc/apt/sources.list'"
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
91
    exit 1
92
fi
93
grep -q "^deb http:.* ${DISTRIB_CODENAME} .*multiverse" /etc/apt/sources.list
94
if [ $? -ne 0 ]; then
13341.1.1 by Bryce Harrington
Fix typo in message referring to /etc/apt/sources.list
95
    echo "Please enable the 'multiverse' component in /etc/apt/sources.list'"
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
96
    exit 1
97
fi
98
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
99
LPDEV_SOURCES="/etc/apt/sources.list.d/launchpad-dev.list"
100
if [ ! -e $LPDEV_SOURCES ]; then
101
  sudo touch $LPDEV_SOURCES
102
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
103
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
104
LP_PPA="deb http://ppa.launchpad.net/launchpad/ppa/ubuntu ${DISTRIB_CODENAME} main"
105
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.
106
if [ $? -ne 0 ]; then
7693.1.3 by Brad Crittenden
Changes due to review
107
  echo "Adding ~launchpad PPA repository to package source list."
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
108
  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.
109
fi
110
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
111
BZR_PPA="deb http://ppa.launchpad.net/bzr/ppa/ubuntu ${DISTRIB_CODENAME} main"
112
grep -q "^${BZR_PPA}" $LPDEV_SOURCES
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
113
if [ $? -ne 0 ]; then
7693.1.3 by Brad Crittenden
Changes due to review
114
  echo "Adding ~bzr PPA repository to package source list."
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
115
  echo "$BZR_PPA" | sudo tee -a $LPDEV_SOURCES
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
116
fi
117
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
118
# 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.
119
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.
120
for key in $REQUIRED_PPA_KEYS; do
121
   sudo apt-key list | grep -q $key
122
   if [ $? -ne 0 ]; then
123
     echo "Retrieving key $key."
13085.1.1 by Deryck Hodge
Update the keyserver URL based on Sorin Sbârnea's suggestion
124
     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.
125
     if [ $? -ne 0 ]; then
126
       echo "Could not retrieve key $key."
127
       exit 1
128
     fi
129
     gpg --export -a $key | sudo apt-key add -
130
     if [ $? -ne 0 ]; then
131
       echo "Could not install key $key."
132
       exit 1
133
     fi
134
   fi
135
done
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
136
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
137
do_install() {
7693.1.3 by Brad Crittenden
Changes due to review
138
  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.
139
  if [ $? -ne 0 ]; then
140
    echo "Installing $pkg package..."
11573.2.1 by Brad Crittenden
aptitude is not installed by default in maverick so use apt-get instead.
141
    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.
142
    if [ $? -ne 0 ]; then
143
      echo "Unable to install $pkg."
144
      exit 1
145
    fi
146
  fi
147
  }
148
11573.2.1 by Brad Crittenden
aptitude is not installed by default in maverick so use apt-get instead.
149
sudo apt-get update
7693.1.5 by Brad Crittenden
Merge from trunk. Fix RFS
150
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.
151
for pkg in $REQUIRED_PACKAGES; do
152
  do_install;
153
done
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
154
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
155
# 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.
156
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.
157
mkdir -p /var/tmp/bazaar.launchpad.dev/mirrors
4706.2.19 by Jonathan Lange
Make the mirrors directory in rocketfuel-setup.
158
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
159
sudo a2enmod proxy > /dev/null
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
160
if [ $? -ne 0 ]; then
161
  echo "ERROR: Unable to enable proxy module in Apache2"
162
  exit 1
163
fi
164
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
165
sudo a2enmod proxy_http > /dev/null
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
166
if [ $? -ne 0 ]; then
167
  echo "ERROR: Unable to enable proxy_http module in Apache2"
168
  exit 1
169
fi
170
4706.2.9 by Jonathan Lange
Update the documentation and add bazaar.launchpad.dev setup to rocketfuel-setup.
171
sudo a2enmod rewrite > /dev/null
172
if [ $? -ne 0 ]; then
173
  echo "ERROR: Unable to enable rewrite module in Apache2"
174
  exit 1
175
fi
176
6991.1.1 by Guilherme Salgado
Serve *.launchpad.dev through https
177
sudo a2enmod ssl > /dev/null
178
if [ $? -ne 0 ]; then
179
  echo "ERROR: Unable to enable ssl module in Apache2"
180
  exit 1
181
fi
182
7140.7.2 by Celso Providelo
Adjust rocketfuel-setup and development apache configuration to use mod_deflate.
183
sudo a2enmod deflate > /dev/null
184
if [ $? -ne 0 ]; then
185
  echo "ERROR: Unable to enable deflate module in Apache2"
186
  exit 1
187
fi
4317.1.1 by Mark Shuttleworth
Initial batch of setup and maintenance scripts for LP
188
7598.6.4 by Brad Crittenden
Added bzr PPA key and brought up-to-date with new apache local-launchpad settings.
189
sudo a2enmod headers > /dev/null
190
if [ $? -ne 0 ]; then
191
  echo "ERROR: Unable to enable headers module in Apache2"
192
  exit 1
193
fi
194
12042.1.3 by Aaron Bentley
Skip local branch configuration if --no-workspace supplied.
195
if [ $DO_WORKSPACE == 0 ]; then
196
  cat <<EOT
197
Branches have not been created, as requested.  You will need to do some or all
198
of the following steps:
199
$ bzr branch lp:launchpad devel
200
$ cd devel
201
$ bzr branch lp:~launchpad/lp-source-dependencies/trunk/ download-cache
202
$ utilities/update-sourcecode
203
$ utilities/launchpad-database-setup
204
$ make schema
205
$ sudo make install
206
EOT
207
  exit 0
208
fi
209
12042.1.2 by Aaron Bentley
Move rocketfuel-env.sh closer to its use.
210
if [ ! -e "$HOME/.rocketfuel-env.sh" ]; then
211
  echo "# Common environment variables for the rocketfuel-* scripts.
212
#
213
# The ones you can set are:
214
#
215
# LP_PROJECT_ROOT - The root directory of all your Launchpad stuff.  Your
216
#                   Launchpad shared repository will live in a child directory
217
#                   of this directory.
218
# LP_SHARED_REPO  - Your Launchpad shared repository directory.  All of your
219
#                   Launchpad development branches will live under here.
220
# LP_TRUNK_NAME   - The directory name (not path!) to your rocketfuel trunk
221
#                   mirror directory.  This is relative to your shared repo.
222
# LP_SOURCEDEPS_DIR - The name of the directory (not path!) where your
223
#                   trunk sourcecode will be placed.  This is relative to your
224
#                   LP_PROJECT_ROOT and should /not/ have the 'sourcecode'
225
#                   path appended to it, since this is automatically added by
226
#                   the scripts.
227
228
LP_PROJECT_ROOT=\${LP_PROJECT_ROOT:=~/launchpad}
229
LP_SHARED_REPO=\${LP_SHARED_REPO:=lp-branches}
230
LP_PROJECT_PATH=\$LP_PROJECT_ROOT/\$LP_SHARED_REPO
231
LP_TRUNK_NAME=\${LP_TRUNK_NAME:=devel}
232
LP_TRUNK_PATH=\$LP_PROJECT_PATH/\$LP_TRUNK_NAME
233
234
LP_SOURCEDEPS_DIR=\${LP_SOURCEDEPS_DIR:=lp-sourcedeps}
235
LP_SOURCEDEPS_PATH=\$LP_PROJECT_ROOT/\$LP_SOURCEDEPS_DIR/sourcecode
236
237
# Force tilde expansion
238
LP_SOURCEDEPS_PATH=\$(eval echo \${LP_SOURCEDEPS_PATH})
239
" > "$HOME/.rocketfuel-env.sh"
240
fi
241
242
source "$HOME/.rocketfuel-env.sh"
243
if [ "$?" != 0 ]; then
244
    echo "Something went wrong with rocketfuel-setup!"
245
    exit 1
246
fi
247
248
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
249
# 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.
250
mkdir -p $LP_PROJECT_ROOT
251
cd $LP_PROJECT_ROOT
6567.2.2 by Barry Warsaw
Respond to review comments.
252
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'.
253
  # 2a format (a.k.a. "brisbane-core") needed for stacking on Launchpad.
254
  bzr init-repo --2a $LP_SHARED_REPO
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
255
  if [ $? -ne 0 ]; then
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
256
    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
257
    exit 1
258
  fi
259
fi
6567.2.2 by Barry Warsaw
Respond to review comments.
260
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.
261
  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
262
  exit 1
263
fi
264
8931.1.5 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user that a certain bzr warning
265
echo "Logging bzr into Launchpad (it's okay if this errors)..."
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
266
bzr launchpad-login $lpusername
8931.1.5 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user that a certain bzr warning
267
if [ $? -ne 0 ]; then
268
  echo ""
269
  echo "You can ignore any error above about not registering an SSH key"
270
  echo "with Launchpad.  Registering an SSH key is only important if you"
271
  echo "are writing data to Launchpad, or trying to access private data."
272
  echo ""
273
fi
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
274
6567.2.2 by Barry Warsaw
Respond to review comments.
275
cd $LP_SHARED_REPO
6567.1.4 by Barry Warsaw
Last minute patch and whitespace normalization.
276
if [ ! -d $LP_TRUNK_NAME ]; then
277
  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
278
  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
279
  if [ $? -ne 0 ]; then
280
    echo "ERROR: Unable to create local copy of Rocketfuel trunk"
281
    exit 1
282
  fi
283
fi
284
6567.1.4 by Barry Warsaw
Last minute patch and whitespace normalization.
285
cd $LP_TRUNK_NAME
9322.4.1 by Simon Olofsson
Fixes: bug 402187: rocketfuel-setup can't resume if fails to complete
286
bzr st -q
287
if [ $? -ne 0 ]; then
288
  echo "ERROR: Your trunk branch in $LP_TRUNK_PATH is corrupted.
289
       Please delete $LP_TRUNK_PATH and run rocketfuel-setup again."
290
       exit 1
291
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
292
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
293
  "//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.
294
  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
295
       incorrect pull location, correcting now..."
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
296
  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
297
  if [ $? -ne 0 ]; then
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
298
    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
299
    exit 1
300
  fi
301
fi
302
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.
303
# Call the newly minted Launchpad branch's 'make install' target to do some
304
# more apache setup.
5543.3.2 by Tim Penhey
Alterations to the way codebrowse is started, and updating rocketfuel-setup
305
sudo make install > /dev/null
306
if [ $? -ne 0 ]; then
307
  echo "ERROR: Unable to install apache config appropriately"
308
  exit 1
309
fi
310
311
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
312
# Set up Bazaar locations configuration
4958.2.3 by Mark Shuttleworth
Make rf-setup create ~/.bazaar if needed
313
if [ ! -d ~/.bazaar ]; then
314
  mkdir ~/.bazaar
315
  if [ $? -ne 0 ]; then
316
    echo "Unable to create ~/.bazaar/ directory"
317
    exit 1
318
  fi
319
fi
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
320
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
321
if [ ! -e ~/.bazaar/locations.conf ]; then
322
  touch ~/.bazaar/locations.conf
323
fi
7598.6.2 by Brad Crittenden
Added LP signing key, moved some items to the default section of bazaar.conf
324
6666.1.2 by Brad Crittenden
Simplified the setting for locations.conf
325
grep -q "\[${LP_PROJECT_PATH}\]" ~/.bazaar/locations.conf
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
326
if [ $? -ne 0 ]; then
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
327
  cat >> ~/.bazaar/locations.conf << EOF
6666.1.2 by Brad Crittenden
Simplified the setting for locations.conf
328
[$LP_PROJECT_PATH]
6666.1.1 by Brad Crittenden
Changes to locations.conf to match RocketFuelSetupDetails
329
submit_branch = ${LP_TRUNK_PATH}
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
330
public_branch = bzr+ssh://bazaar.launchpad.net/~${lpusername}/launchpad
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
331
public_branch:policy = appendpath
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
332
push_location = lp:~${lpusername}/launchpad
4317.1.6 by Mark Shuttleworth
Make sure new stanza in ~/.bazaar/locations.conf starts on its own line
333
push_location:policy = appendpath
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
334
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
335
submit_to = merge@code.launchpad.net
7426.1.1 by Julian Edwards
Tweak rocketfuel-setup so that:
336
EOF
4317.1.3 by Mark Shuttleworth
Also fixup ~/.bazaar/locations.conf
337
6666.1.1 by Brad Crittenden
Changes to locations.conf to match RocketFuelSetupDetails
338
grep -q "\[$LP_TRUNK_PATH\]" ~/.bazaar/locations.conf
339
if [ $? -ne 0 ]; then
340
  echo "
341
[$LP_TRUNK_PATH]
7598.6.6 by Brad Crittenden
Fixed location of public_branch
342
public_branch = bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel\
6666.1.1 by Brad Crittenden
Changes to locations.conf to match RocketFuelSetupDetails
343
" | tee -a ~/.bazaar/locations.conf > /dev/null
344
fi
345
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
346
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
347
348
fi
349
8931.1.4 by Karl Fogel
* utilities/rocketfuel-setup: Tell the user to hit Return after
350
# Set up scripts in /usr/local/bin
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
351
cd /usr/local/bin
352
if [ ! -e rocketfuel-get ]; then
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
353
  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
354
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
355
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
356
if [ $? -ne 0 ]; then
357
  echo "WARNING: /usr/local/bin/rocketfuel-get should be deleted so I can
358
         recreate it."
359
fi
5323.2.1 by Mark Shuttleworth
Manage featured projects in the db
360
if [ ! -e rocketfuel-flakes ]; 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-flakes
5323.2.1 by Mark Shuttleworth
Manage featured projects in the db
362
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
363
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
364
if [ $? -ne 0 ]; then
365
  echo "WARNING: /usr/local/bin/rocketfuel-flakes should be deleted so I can
366
         recreate it."
367
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
368
if [ ! -e rocketfuel-branch ]; 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-branch
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
370
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
371
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
372
if [ $? -ne 0 ]; then
373
  echo "WARNING: /usr/local/bin/rocketfuel-branch should be deleted so I can
374
         recreate it."
375
fi
376
if [ ! -e rocketfuel-setup ]; 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-setup
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-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
380
if [ $? -ne 0 ]; then
381
  echo "WARNING: /usr/local/bin/rocketfuel-setup should be deleted so I can
382
         recreate it."
383
fi
4343.1.3 by Mark Shuttleworth
Add symlink for rocketfuel-status
384
if [ ! -e rocketfuel-status ]; 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-status
4343.1.3 by Mark Shuttleworth
Add symlink for rocketfuel-status
386
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
387
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
388
if [ $? -ne 0 ]; then
389
  echo "WARNING: /usr/local/bin/rocketfuel-status should be deleted so I can
390
         recreate it."
391
fi
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
392
if [ ! -e rocketfuel-push ]; 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-push
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
394
fi
6567.1.2 by Barry Warsaw
Parameterized most paths so this script is more useful to everyone.
395
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
396
if [ $? -ne 0 ]; then
397
  echo "WARNING: /usr/local/bin/rocketfuel-push should be deleted so I can
398
         recreate it."
399
fi
4317.1.2 by Mark Shuttleworth
Extend utility scripts to handle local branch structure creation too
400
401
402
# Make sure we have all the right code in place for source dependencies
403
/usr/local/bin/rocketfuel-get
404
4317.1.5 by Mark Shuttleworth
Also setup ssh access to bazaar.launchpad.dev
405
echo "
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
406
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
407
committing changes to Launchpad in utilities/rocketfuel-setup.
4317.1.5 by Mark Shuttleworth
Also setup ssh access to bazaar.launchpad.dev
408
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
409
Please see http://dev.launchpad.net/ for more information on
410
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.
411
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
412
You can use the following commands to manage your Launchpad
413
development environment:
4920.2.13 by Mark Shuttleworth
Add rocketfuel-push script and make rocketfuel-setup aware of it
414
415
 rocketfuel-get
8931.1.1 by Karl Fogel
Use more appropriate defaults for LP_PROJECT_ROOT and LP_TRUNK_NAME.
416
    Update your copy of $LP_TRUNK_NAME and the necessary source
417
    dependencies, and make sure all source dependencies are properly
418
    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.
419
420
 rocketfuel-branch foo
8234.1.7 by Gary Poster
rocketfuel scripts and download cache are in place now.
421
    Create a new branch of LP called \"foo\" in
422
    $LP_PROJECT_PATH/foo,
6567.1.3 by Barry Warsaw
parameterize all paths so that launchpad code can live anywhere.
423
    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
424
425
 rocketfuel-status
8234.1.7 by Gary Poster
rocketfuel scripts and download cache are in place now.
426
    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
427
    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.
428
    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
429
430
 rocketfuel-push
7693.1.1 by Brad Crittenden
Corrected GPG key for bzr, add apache2 to installed packages, add lp:~launchpad ppa key.
431
    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
432
    backup of everything.
4317.1.5 by Mark Shuttleworth
Also setup ssh access to bazaar.launchpad.dev
433
434
Happy hacking!
435
"