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:

Do not connect P4 Code Review to P4 Broker, P4 Proxy, an edge server, forwarding replica, or read-only replica servers.

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.
  1. 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.repo with the following content:

    [Perforce]
    name=Perforce
    baseurl=http://package.perforce.com/yum/rhel/7/x86_64/
    enabled=1
    gpgcheck=1
  2. 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.

  3. Install the main P4 Code Review package on the server to host P4 Code Review (run these commands as root):

    1. Deploy the epel-release-latest-7.noarch.rpm repository configuration package to give P4 Code Review access to EPEL packages:
    2. yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    3. 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):
    4. 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.

    5. Install the yum-utils package to give access to the yum-config-manager command:
    6. yum install yum-utils

    7. RHEL only: Enable the optional channel for some dependencies:
    8. subscription-manager repos --enable=rhel-7-server-optional-rpms

    9. Install the Default/Single version of PHP:
      1. Disable remi-php*:
      2. yum-config-manager --disable 'remi-php*'

      3. Enable PHP 7.4:
      4. yum-config-manager --enable remi-php74

      5. Run an upgrade for PHP:
      6. yum update

    10. Install P4 Code Review and accept the prompts to import the GPG keys for Remi and EPEL when requested:
    11. 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 firewalld

      If you subsequently wish to enable HTTPS, run (as root):

      sudo firewall-cmd --permanent --add-service=https
      sudo systemctl reload firewalld

  4. 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/scripts to the server hosting your P4 Server. The swarm-trigger.pl is 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.conf that 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

  5. 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

  6. Complete the Post-installation configuration steps.