How to install and configure the CLI in an air-gapped environment
If your company has restrictions on what you can access via the internet, you'll need to download and configure the Moderne CLI in a special way. This doc will walk you through everything you need to know for this. By the end, you will have the CLI downloaded and configured in your air-gapped environment.
Assumptions
You can't access app.moderne.io from your environment
You have an internal mirror of Maven Central (or some other internal artifact repository)
You have the ability to download and add JARs from Maven Central to your internal artifact repository
Installation and configuration
Step 1: Download the Moderne CLI JAR
Download the latest version of the Moderne CLI from Maven Central. Once downloaded, please add it to your internal mirror so that it's accessible for all users in your environment.
Step 2: (Optional - but recommended) Create an alias for the Moderne CLI JAR
While not required, you are strongly encouraged to set up an alias for running the CLI JAR. Below are some ways you might configure this depending on your OS and terminal:
Add the following function to your .bashrc
file:
If everything was configured correctly, you should be able to type mod
into your terminal and see a list of commands:
Step 3: Configure the CLI to use your license
In order to run recipes, you'll need to ensure the CLI is configured with a license. You should have received a license from us. With that license, please run the following command:
For more information on the Moderne CLI license, please see our license documentation
Step 4: Configure the CLI to point to your internal artifact repository
In order for the CLI to have access to read and publish LSTs, it will need to be provided with the path to your Maven settings file. This likely exists on developer machines for the sake of redirecting requests from Maven Central to an internal artifact instance.
Run the following command to point the CLI to your Maven settings file:
After that, configure the connection to your artifact repository by running one of the following commands (depending on the type of artifact repository you're using):
Step 5: Install recipe JARs
For each of the GAV coordinates below, please ensure that the artifact has been added to your internal artifact repository (assuming that your artifact repository is not a pure remote proxy to Maven Central already or that there isn't some automatic procurement step at dependency resolution time):
Next steps
You're now ready to begin using the CLI! Consider checking out the using the CLI section in the getting started guide to see some ways you can use the CLI.
Last updated