Skip to content

Instantly share code, notes, and snippets.

@ssmythe
Last active May 20, 2016 07:05
Show Gist options
  • Save ssmythe/08803405033335a75f3e to your computer and use it in GitHub Desktop.
Save ssmythe/08803405033335a75f3e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "p4d: install p4 yum repo"
cat > /etc/yum.repos.d/perforce.repo <<EOF
[perforce]
name=Perforce
baseurl=http://package.perforce.com/yum/rhel/6/x86_64/
enabled=1
gpgcheck=1
EOF
echo "p4d: install p4 yum repo signing key"
rpm --import http://package.perforce.com/perforce.pubkey
echo "p4d: install p4d via latest RPM"
yum -y install perforce-server
# echo "p4d: Installing p4d 2011.1 from download"
# curl -ssL http://ftp.perforce.com/perforce/r11.1/bin.linux26x86_64/p4d -o /opt/perforce/sbin/p4d
P4PORT=1666
P4DIR="/p4/p4-${P4PORT}"
echo "p4d: creating p4d server directory: ${P4DIR}"
if [ ! -d "${P4DIR}" ]; then
mkdir -p "${P4DIR}"
chown perforce:perforce "${P4DIR}"
fi
echo "p4d: configuring p4d"
cat > /etc/perforce/p4dctl.conf.d/p4-${P4PORT}.conf <<EOF
p4d p4-${P4PORT}
{
Owner = perforce
Execute = /opt/perforce/sbin/p4d
Umask = 077
# Enabled by default.
Enabled = true
Environment
{
P4ROOT = /p4/p4-${P4PORT}
P4JOURNAL = journal
P4PORT = 1666
P4SSLDIR = ssl
PATH = /bin:/usr/bin:/usr/local/bin:/opt/perforce/bin:/opt/perforce/sbin
}
}
EOF
echo "p4d: configuring p4d"
/usr/sbin/p4dctl start p4-${P4PORT}
echo "p4d: verifying p4d is running"
/usr/bin/p4 -p localhost:${P4PORT} info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment