Before installing or updating ShiftLeft Ocular, make sure you have met all requirements. In addition, for large applications, you may want to optimize ShiftLeft Ocular performance through the appropriate combination of memory and disk sizes.
Note: Do not make any changes to any directories, except the installation and policy directories.
Once you have installed or updated ShiftLeft Ocular, you start ShiftLeft Ocular.
There are currently two methods for installing, licensing and updating ShiftLeft Ocular:
Code analysis can require lots of memory, and unfortunately, the JVM does not pick up the available amount of memory by itself. While tuning Java memory usage is a discipline in its own right, it is usually sufficient to specify the maximum available amount of heap memory using the JVM's
-Xmx flag. The easiest way to achieve this globally is by setting the environment variable
_JAVA_OPTS as follows:
$N is the amount of memory in gigabytes. You can add this line to your shell startup script, e.g.,
Refer to the article Memory Size Recommendations for more information.
To download and license ShiftLeft Ocular via subscription:
Run the CLI
sl ocular command and options. The directory
~/.shiftleft/ocular is automatically created, and ShiftLeft Ocular is installed there.
To update ShiftLeft Ocular, run the command
sl update ocular.
If you are updating an existing version of ShiftLeft Ocular via subscription, ShiftLeft Ocular automatically backs up the files in your workspace, including custom Policies. You are provided with information on the backup process, and asked to manually review any differences between the new downloaded files and existing files in the backup directory.
The process of installing ShiftLeft Ocular using the distribution file is:
Unzip the Ocular distribution ZIP file provided by ShiftLeft, by issuing the following command
$ unzip ocular-distribution-[version].zip
[version] is the actual version number of the distribution file.
Enter the password you received from ShiftLeft. The folder
ocular-distribution is created.
Navigate to the folder
ocular-distribution. From there, for Linux and MacOS X run the installer using the
./install.sh command. For the Windows OS, run the installing using the command
.\install.ps1 and then follow the prompt.
If you don't have permission, first use the command
chmod +x install.sh and then run the installer again.
Identify where you want to install ShiftLeft Ocular (defaults to
~/bin/ocular on Linux and MacOS X, and to
C:\Users\$USERNAME\bin\ocular on Windows).
You can determine your current version of ShiftLeft Ocular by using the
version command. To update ShiftLeft Ocular:
Repeat steps 1 - 4 from above.
Specify how you want the update to proceed. Enter either
y to replace an existing ShiftLeft Ocular installation,
nto not replace the existing installation,
Ato install all ShiftLeft Ocular files,
N to install no ShiftLeft Ocular files, or
r to rename the installation directory.