| #!/bin/bash |
| # Set up common image to build other nodes from |
| |
| # Install necessary packages |
| apt-get update -qq |
| apt-get install -qq iproute2 openssh-server psmisc python-minimal sudo |
| |
| # Set up integ user and SSH |
| adduser --disabled-password --gecos "" integ |
| echo "integ ALL=(ALL:ALL) NOPASSWD:ALL" >/etc/sudoers.d/integ |
| mkdir -p /home/integ/.ssh |
| cp /integ/temp/sshkey /home/integ/.ssh/id_rsa |
| cp /integ/temp/sshkey.pub /home/integ/.ssh/id_rsa.pub |
| cat /home/integ/.ssh/id_rsa.pub >> /home/integ/.ssh/authorized_keys |
| chown -R integ:integ /home/integ/.ssh |
| chmod -R 700 /home/integ/.ssh |
| |
| # Copy integ folder and build+install packages |
| cp -R /integ /home/integ/integration-tests |
| chown -R integ:integ /home/integ/integration-tests |
| cd /home/integ/integration-tests && sudo -u integ ./install_apps.py install_all 2>&1 | tee install.log |
| chown integ:integ install.log |
| rm -rf prepare |
| cd install_helpers/tools && sudo -u integ make clean |
| |
| # Clean up |
| sudo apt-get clean |