Install P4 Code Review on CentOS/RHEL 7
-
We recommend that the latest point release is used. At the time of this P4 Code Review release, the latest stable CentOS/RHEL 7 release is 7.9.
-
P4 Code Review does not support P4 Servers that are configured to use P4AUTH. For more information, see Authorization server (P4AUTH).
P4 Code Review can be connected to P4 Servers (P4D) and commit servers:
- To configure P4 Code Review to connect to more than one P4 Server, see Multiple P4 Server instances.
- To configure P4 Code Review to connect to a P4 Server configured to use commit-edge architecture, see Commit-edge deployment.
P4 Code Review does not support P4 Servers that are configured to use P4AUTH. For more information, see Authorization server (P4AUTH).
Installation
Prerequisites:
-
Review the runtime dependencies before you install P4 Code Review, see Runtime dependencies.
-
Review the PHP requirements before you upgrade P4 Code Review, see PHP.
- Review the P4 Server requirements before you install P4 Code Review, see P4 Server requirements.
- Before continuing with the P4 Code Review install process, you must register the RHEL system to Red Hat using the Subscription Manager client.
-
Configure the Perforce package repository, on the server to host P4 Code Review and on the server hosting your P4 Server.
If the server hosting your P4 Server cannot use packages, for example when it is running Windows, skip this step on that server.
As root, create the file
/etc/yum.repos.d/perforce.repowith the following content:[Perforce]
name=Perforce
baseurl=http://package.perforce.com/yum/rhel/7/x86_64/
enabled=1
gpgcheck=1 -
Import the Perforce package signing key, on the server to host P4 Code Review and the server hosting your P4 Server.
If the server hosting your P4 Server cannot use packages, for example when it is running Windows, skip this step on that server.
Run the following command as root:
rpm --import https://package.perforce.com/perforce.pubkey
For information about how to verify the authenticity of the signing key, see Perforce Packages.
-
Install the main P4 Code Review package on the server to host P4 Code Review (run these commands as root):
- Deploy the epel-release-latest-7.noarch.rpm repository configuration package to give P4 Code Review access to EPEL packages:
- Deploy the Remi repository configuration package to give P4 Code Review access to PHP 7.x (only required the first time you upgrade to PHP 7.x):
- Install the yum-utils package to give access to the yum-config-manager command:
- RHEL only: Enable the optional channel for some dependencies:
- Install the Default/Single version of PHP:
- Disable remi-php*:
- Enable PHP 7.4:
- Run an upgrade for PHP:
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php74
yum update
- Install P4 Code Review and accept the prompts to import the GPG keys for Remi and EPEL when requested:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
If you don't deploy the Remi repository, you will see dependency errors when you do the next steps.yum install yum-utils
subscription-manager repos --enable=rhel-7-server-optional-rpms
yum install helix-swarm
When the P4 Code Review installation has completed, you are prompted to run the configure-swarm.sh post-installation script.Do not run this script until you have completed the rest of these Installation instructions. Instructions for running the configure-swarm.sh post-installation script are in the Post-Installation configuration section referenced in the final step of the Installation instructions.
The firewall configuration may need to be adjusted to allow access to the web server.
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalldIf you subsequently wish to enable HTTPS, run (as root):
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld -
P4 Code Review needs to know about some P4 Server events to operate correctly. Use P4 Server Extensions (recommended) or P4 Server Triggers to notify P4 Code Review about these events. The P4 Server extension can be installed automatically by the P4 Code Review configure-swarm.sh post-installation script, but Triggers must be manually installed. To use P4 Server Extensions, ignore this step and skip to the next step.
Trigger installation only (not recommended): Install the P4 Code Review triggers package on the server hosting your P4 Server. This might be the server hosting P4 Code Review or elsewhere on your network.
If the server hosting your P4 Server cannot use packages, for example when it is running Windows, copy the appropriate P4 Code Review trigger script from/opt/perforce/swarm/p4-bin/scriptsto the server hosting your P4 Server. Theswarm-trigger.plis for both Linux and Windows systems. Once copied, the trigger script needs to be configured. See Installing triggers for details.The package installs a config file at
/opt/perforce/etc/swarm-trigger.confthat you will need to modify. See Installing triggers for more details on configuring that file.Install the P4 Code Review triggers package on the server hosting your P4 Server (run this command as root):
yum install helix-swarm-triggers
-
Optional: Install the P4 Code Review optional package, on the server hosting P4 Code Review.
While not required, installing this package installs the dependencies required to use the ImageMagick and LibreOffice P4 Code Review modules. These modules provide previews of a variety of image and office documents. Run this command as root:
yum install helix-swarm-optional
-
Complete the Post-installation configuration steps.