~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/rocketfuel-setup

  • Committer: Launchpad Patch Queue Manager
  • Date: 2009-06-02 22:44:27 UTC
  • mfrom: (8486.13.6 devpad-free-bug-372813)
  • Revision ID: launchpad@pqm.canonical.com-20090602224427-t4xb1a1zptzj8jkt
[r=bac,
        gary][ui=none] [bug 372813] Remove devpad from rocketfuel scripts.
        Currently listening to Talk Talk -- Desire.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
# load up Ubuntu release details so we know which repos to enable
46
46
source /etc/lsb-release
47
47
 
48
 
# Establish Canonical username
 
48
# Establish LP username
49
49
whoami=`whoami`
50
 
printf "What is your username on Canonical servers? [$whoami] "
51
 
read canusrname
52
 
if [ ! -z ${canusrname} ]; then
53
 
  whoami=${canusrname};
54
 
fi
55
 
 
56
 
# Test that we can access Canonical servers
57
 
ssh ${whoami}@chinstrap.canonical.com pwd > /dev/null
58
 
if [ $? -ne 0 ]; then
59
 
  echo "
60
 
ERROR: Unable to login to chinstrap, please check your Canonical account
61
 
details.
62
 
"
63
 
  exit 1
64
 
fi
65
 
 
66
 
# Establish LP username
67
50
printf "What is your Launchpad username? [$whoami] "
68
51
read lpusername
69
52
if [ -z ${lpusername} ]; then
170
153
  read
171
154
fi
172
155
 
173
 
grep -q "^Host .*chinstrap" ~/.ssh/config
174
 
if [ $? -ne 0 ]; then
175
 
  echo "Please add the following directives to your ~/.ssh/config:
176
 
------------------------------------------------------------
177
 
Host chinstrap chinstrap.canonical.com chinstrap.ubuntu.com
178
 
    ForwardAgent yes
179
 
    Hostname chinstrap.canonical.com
180
 
    ProxyCommand none
181
 
    User ${whoami}
182
 
------------------------------------------------------------
183
 
"
184
 
  read
185
 
fi
186
 
 
187
 
grep -q "^Host.*\*\.canonical.com" ~/.ssh/config
188
 
if [ $? -ne 0 ]; then
189
 
  echo "Please add the following directives to your ~/.ssh/config:
190
 
------------------------------------------------------------
191
 
Host *.canonical.com *.ubuntu.com
192
 
    ForwardAgent yes
193
 
    ProxyCommand ssh chinstrap.canonical.com nc -q0 %h %p
194
 
    User ${whoami}
195
 
------------------------------------------------------------
196
 
"
197
 
  read
198
 
fi
199
 
 
200
 
grep -q "^Host .*devpad" ~/.ssh/config
201
 
if [ $? -ne 0 ]; then
202
 
  echo "Please add the following directives to your ~/.ssh/config:
203
 
------------------------------------------------------------
204
 
Host devpad devpad.canonical.com
205
 
    ForwardAgent yes
206
 
    Hostname devpad.canonical.com
207
 
    ProxyCommand ssh chinstrap.canonical.com nc -q0 %h %p
208
 
    User ${whoami}
209
 
------------------------------------------------------------
210
 
"
211
 
  read
212
 
fi
213
 
 
214
156
grep -q "^Host .*bazaar.launchpad.dev" ~/.ssh/config
215
157
if [ $? -ne 0 ]; then
216
158
  echo "Please add the following directives to your ~/.ssh/config:
240
182
fi
241
183
 
242
184
 
243
 
echo "Testing ssh to devpad..."
244
 
ssh devpad.canonical.com pwd > /dev/null
245
 
if [ $? -ne 0 ]; then
246
 
  echo "
247
 
ERROR: Unable to verify capability to ssh to devpad. Please check
248
 
~/.ssh/config and check the User configuration item.  ['${whoami}']"
249
 
  exit 1
250
 
fi
251
 
 
252
 
sudo apt-key list | grep -q "2048g/CA6E8A17"
253
 
if [ $? -ne 0 ]; then
254
 
  echo "Retrieving signing-key for LP package repository."
255
 
  scp devpad.canonical.com:/code/lp-maintainers.pub /tmp/
256
 
  if [ $? -ne 0 ]; then
257
 
    echo "Unable to fetch key for LP package repository"
258
 
    exit 1
259
 
  fi
260
 
  [ `sha1sum /tmp/lp-maintainers.pub | cut -d " " -f 1` = \
261
 
     f1714a57bd8c481f45b2a64e2eb9131176c8922e ] \
262
 
  && sudo apt-key add /tmp/lp-maintainers.pub
263
 
  if [ $? -ne 0 ]; then
264
 
    echo "Unable to add key for LP package repository"
265
 
    exit 1
266
 
  fi
267
 
fi
268
 
 
269
185
LPDEV_SOURCES="/etc/apt/sources.list.d/launchpad-dev.list"
270
186
if [ ! -e $LPDEV_SOURCES ]; then
271
187
  sudo touch $LPDEV_SOURCES