#!/bin/bash set -u # Usage: # Run with no args, or optionally a 'branch' arg with value of the branch # of the Helix Installer to use (e.g. 'main' or 'dev'). If omitted, the # branch is detected if possible, or else defaulted to 'main'. # Bootstraps a new Linux server with requirements Helix Installer testing. function msg () { echo -e "$*"; } #shellcheck disable=SC2086 function bail () { msg "\\nError: ${1:-Unknown Error}\\n"; exit ${2:-1}; } declare Version=1.0.1 declare Branch=${1:-Unset} msg "Starting ${0##*/} v$Version at $(date)." if [[ "$Branch" == "Unset" ]]; then if [[ "$PWD" == *"/dev/"* ]]; then Branch="dev" elif [[ "$PWD" == *"/main/"* ]]; then Branch="main" else Branch="dev" msg "Warning: Helix Installer branch auto-detect failed; Using '$Branch'." fi fi # Currently, RHEL/CentOS is supported, Ubuntu is not (yet) supported. if [[ -r "/etc/redhat-release" ]]; then msg "Verified: Running on supported Red Hat or similar Linux OS." elif [[ -r "/etc/lsb-release" ]]; then bail "Running on unsupported Ubuntu or similar Linux OS. Aborting." else msg "Warning: Running on unknown OS. Hoping for the best." fi sudo yum install -y gcc gcc-c++ rsync zlib-devel openssl-devel sudo useradd perforce #shellcheck disable=SC2024 sudo echo -e " # Source global definitions [[ -r /etc/bashrc ]] && source /etc/bashrc # User specific aliases and functions [[ -r /p4/common/bin/p4_vars ]] && source /p4/common/bin/p4_vars 1 export PS1='\$USER@\${HOSTNAME%%.*}:\$PWD ' alias cls=clear alias md='mkdir -p' alias rd=rmdir alias o='p4 opened ...' set -o vi" > ~perforce/.bashrc msg "Adding perforce to sudoers." #shellcheck disable=SC2024 sudo sed s:vagrant:perforce:g /etc/sudoers.d/vagrant > /tmp/perforce.sudo.$$ sudo cp /tmp/perforce.sudo.$$ /etc/sudoers.d/perforce sudo chmod 400 /etc/sudoers.d/perforce sudo rm /tmp/perforce.sudo.$$ sudo mkdir -p /hxdepots/reset sudo chown -R perforce:perforce /hxdepots/reset cd /hxdepots/reset || bail "Failed to do 'cd /hxdepots/reset'. Aborting." curl -k -s -O https://swarm.workshop.perforce.com/downloads/guest/perforce_software/helix-installer/main/src/reset_sdp.sh sudo chmod +x reset_sdp.sh HelixInstallerVersion=$(grep '^Version=' reset_sdp.sh) HelixInstallerVersion=${HelixInstallerVersion#declare } msg "Installer Installer version: $HelixInstallerVersion" msg "Updating the /etc/hosts to add host aliases." #shellcheck disable=SC2024 sudo echo -e "127.0.0.1\\tbos-helix bos-perforce helix perforce swarm" >> /etc/hosts HelixInstallerCmd="./reset_sdp.sh -b $Branch" msg "Calling Helix Installer: $HelixInstallerCmd" #shellcheck disable=SC2086,SC2024 sudo $HelixInstallerCmd > reset_sdp.log 2>&1
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#14 | 27427 | C. Thomas Tyler |
Released SDP 2021.2.27425 (2021/02/09). Copy Up using 'p4 copy -r -b perforce_software-helix-installer-dev'. |
||
#13 | 26975 | C. Thomas Tyler | Released HelixInstaller 2020.2.26973 (2020/12/01). | ||
#12 | 26831 | C. Thomas Tyler | Released HelixInstaller/MultiArch/2020.1/26829 (2020/10/07). | ||
#11 | 26793 | C. Thomas Tyler | Released HelixInstaller/MultiArch/2020.1/26784 (2020/09/25). | ||
#10 | 26578 | C. Thomas Tyler | Released Helix Installer 2020.1.26576 (2020/06/17). | ||
#9 | 26031 | C. Thomas Tyler | Released Helix Installer 2019.4.26026 (2019/08/22). | ||
#8 | 26008 | C. Thomas Tyler | Released HelixInstaller 2019.4.26006 (2019/08/20). | ||
#7 | 25999 | C. Thomas Tyler | Released HelixInstaller 2019.4.25995 (2019/08/20). | ||
#6 | 25900 | C. Thomas Tyler | Released HelixInstaller 2019.3.25890 (2019/07/24). | ||
#5 | 25822 | C. Thomas Tyler | Released HelixInstaller/MultiArch/2019.3/25820 (2019/07/11). | ||
#4 | 25725 | C. Thomas Tyler | Released HelixInstaller/MultiArch/2019.2/25723 (2019/06/19). | ||
#3 | 25166 | C. Thomas Tyler | Released Helix Installer 2019.1.25164 (2019/02/22). | ||
#2 | 24914 | C. Thomas Tyler | Released HelixInstaller 2018.2.24912. | ||
#1 | 24865 | C. Thomas Tyler | Released HelixInstaller v2018.2.24862. | ||
//guest/perforce_software/helix-installer/dev/test/bootstrap-linux.sh | |||||
#1 | 24860 | C. Thomas Tyler |
Added basic Vagrant test suite for Helix Installer for testing on CentOS 6.10. |