2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements. See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 LIB=/opt/clearwater-live-test
20 COMMAND=/usr/bin/clearwater-live-test
23 QUAFF_OLD_URL=git@github.com:metaswitch/quaff.git
24 QUAFF_NEW_URL=https://github.com/Metaswitch/quaff.git
27 yes | aptdcon --hide-terminal --install build-essential
28 yes | aptdcon --hide-terminal --install bundler
29 yes | aptdcon --hide-terminal --install git
31 # Required by nokogiri Ruby gem
32 yes | aptdcon --hide-terminal --install zlib1g-dev
34 # Install Ruby enVironment Manager
35 if [ ! -d "$RVM" ]; then
37 curl --location https://get.rvm.io | bash -s stable
40 # Install Ruby using RVM
43 rvm install "$RUBY_VERSION"
44 rvm use "$RUBY_VERSION@global"
46 # Install Clearwater Live Test
47 if [ ! -d "$LIB" ]; then
50 git clone --depth 1 https://github.com/Metaswitch/clearwater-live-test.git
51 cd clearwater-live-test
54 # Note: we must fix the URLs for Quaff
55 sed --in-place --expression "s,$QUAFF_OLD_URL,$QUAFF_NEW_URL,g" Gemfile Gemfile.lock
57 # Install required Ruby gems
62 echo "#!/bin/bash" > "$COMMAND"
63 echo ". \"$RVM/scripts/rvm\"" >> "$COMMAND"
64 echo "rvm use \"$RUBY_VERSION@global\"" >> "$COMMAND"
65 echo "cd \"$LIB\"" >> "$COMMAND"
66 echo "rake \"\$@\"" >> "$COMMAND"
69 # clearwater-live-test test[example.com] SIGNUP_CODE=secret PROXY=192.168.1.171 ELLIS=192.168.1.171