bootstrap-centos.sh #1

  • //
  • guest/
  • perforce_software/
  • cbd/
  • main/
  • test/
  • bootstrap-centos.sh
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/usr/bin/env bash
# This bootstraps a new CentOS server with the Perforce SDP.

cd /tmp

# Even though it's a test/demo environment, we don't want any
# ShellShock or Heartbleed or whatnot.
sudo yum update -y

# Tools required to compile and build Python
sudo yum groupinstall -y "Development tools"
sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

echo /usr/local/lib>> sudo /etc/ld.so.conf

# Python 3.3 required
echo "Downloading Python"
wget -q http://www.python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
tar xJf ./Python-3.3.5.tar.xz
cd ./Python-3.3.5
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && sudo make altinstall

# Build P4Python
cd /tmp
mkdir p4python
cd p4python
echo "Downloading P4API and P4Python"
wget -q ftp://ftp.perforce.com/perforce/r14.1/bin.linux26x86_64/p4api.tgz
tar xzf p4api.tgz
wget -q ftp://ftp.perforce.com/perforce/r14.1/bin.tools/p4python.tgz
tar xzf p4python.tgz
P4PYTHON_PATH=`find /tmp/p4python/ -name "p4python-*"`
cd $P4PYTHON_PATH
API_PATH=`find /tmp/p4python/ -name "p4api-*" -type d`
mv setup.cfg setup.cfg.bak
echo [p4python_config] > setup.cfg
echo p4_api=$API_PATH>> setup.cfg
sudo /usr/local/bin/python3.3 setup.py install
# Change User Description Committed
#5 22191 C. Thomas Tyler Copy Up using 'p4 copy -r -b perforce_software-cbd-dev'.
#4 15940 C. Thomas Tyler Fixed a broken 'echo' to update the shared library load default path
to include /usr/local/lib.

I'm not 100% sure this update of the library path is needed; it has been
working fine without it (as it was broken anyway due to a typo).  This was
inherited from the SDP test suite bootstrap script from used as a baseline
for the CBD test suite.

#review-15941 @robert_cowham
#3 15009 C. Thomas Tyler Promoted CBD development work to main from dev.
#2 11366 C. Thomas Tyler Promoted CBD from dev to main.
#1 11356 C. Thomas Tyler Promotion from Dev Branch.

       What's included:
       * CBD scripts for Streams as demonstrated at Merge 2014.
       * Deletion of files from the original PoC that aren't needed.

       What's coming later, still work in progress on the dev branch:
       * Documentation.
       * Test Suite with complete Vagrant-based Test Environment.
       * CBD scripts for Classic.
//guest/perforce_software/cbd/dev/test/bootstrap-centos.sh
#1 11354 C. Thomas Tyler Started work on Vagrant test harness.