#!/bin/bash set -u # Usage: # bootstrap-linux.sh [<SDPBranch> [<HelixInstallerBranch>]] # The <SDPBranch> parameter (must be first argument) and # <HelixInstallerBranch> parameter (must be second argument) # are optional. SDPBranch determines the branch of the # SDP to test with, 'main' by default but can be 'dev'. The # HelixInstallerBranch is auto-detected based on the current # directory if possible, otherwise 'dev' by default, but can # be 'main'. # Bootstraps a new Linux server with requirements Helix Installer testing. function msg () { echo -e "$*"; } function bail () { msg "\\nError: ${1:-Unknown Error}\\n"; exit "${2:-1}"; } declare Version=1.4.2 declare SDPBranch=${1:-main} declare HelixInstallerBranch=${2:-UNSET} declare HelixInstallerArgs= msg "Starting ${0##*/} v$Version at $(date)." if [[ "$HelixInstallerBranch" == "UNSET" ]]; then if [[ "$PWD" == *"/dev/"* ]]; then HelixInstallerBranch="dev" msg "Helix Installer branch detected as to '$HelixInstallerBranch'." elif [[ "$PWD" == *"/main/"* ]]; then HelixInstallerBranch="main" msg "Helix Installer branch detected as to '$HelixInstallerBranch'." else HelixInstallerBranch="dev" msg "Helix Installer branch defaulted to '$HelixInstallerBranch'." fi fi # Currently, RHEL/CentOS and Ubuntu flavors are supported. # See release notes for more specific details of which versions are # currently supported. if [[ -r "/etc/redhat-release" ]]; then msg "Verified: Running Red Hat or similar Linux OS." elif [[ -r "/etc/lsb-release" ]]; then msg "Verified: Running Ubuntu or similar Linux OS." else msg "Warning: Running on unknown OS. Hoping for the best." fi if [[ -d /hxdepots/test-reset ]]; then [[ -d /hxdepots/reset ]] && \ bail "Directory /hxdepots/reset unexpectedly exists at bootstrap!" if [[ -d /hxdepots ]]; then msg "Using existing /hxdepots volume provisioned at bootstrap." else msg "Initializing /hxdepots dir." sudo mkdir /hxdepots fi msg "Testing files from local dev workspace." sudo cp -pr /hxdepots/test-reset /hxdepots/reset cd /hxdepots/reset || bail "Failed to do 'cd /hxdepots/reset'. Aborting." else msg "Acquiring reset_sdp.sh from Workshop." sudo mkdir -p /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/$HelixInstallerBranch/src/reset_sdp.sh" sudo chmod +x reset_sdp.sh fi HelixInstallerVersion=$(grep '^declare Version=' reset_sdp.sh) HelixInstallerVersion=${HelixInstallerVersion#declare } msg "Helix Installer version: $HelixInstallerVersion" HelixInstallerCmd="./reset_sdp.sh" HelixInstallerArgs="-fast -b $SDPBranch -i $HelixInstallerBranch" #HelixInstallerArgs="-b $SDPBranch -i $HelixInstallerBranch" msg "Calling Helix Installer: $HelixInstallerCmd" #shellcheck disable=SC2086,SC2024 sudo $HelixInstallerCmd $HelixInstallerArgs > log.reset_sdp.txt 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. |