Configure Mix Client with Hex Virtual Repository

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

This topic describes how to configure Hex virtual repository to deploy and resolve packages using Hex virtual repositories in Artifactory. It provides instructions to configure the mix client to deploy and resolve packages via Hex virtual repositories.

Connect your Mix client to the hex virtual repository to resolve dependencies from the following:

  • Hex Local Repository

  • Hex Remote Repository

    • Public (hex.pm)

    • Private (hex.pm)

    • Self-hosted

Prerequisite

Download Public Key to Hex Project Folder

To set up your Mix client pointing to Hex virtual repository, use the following command from your project folder:

Refer to View Set Me Up Instructions - Hex Repository topic to view Configure code snippets.

Note

Make sure to replace the placeholders in bold with your token, JFrog domain name, port, and JFrog repository key. These placeholders are auto-populated if you copy the Set Up A Hex Client Configure code snippets from the UI.

Run the following command in the Hex project directory to add your Artifactory Virtual repository in the mix client:

mix hex.repo set hexpm --url https:<YOUR_JFROG_DOMAIN>:<PORT>/artifactory/api/hex/<REPOSITORY_NAME> --auth-key "Bearer <TOKEN>" --public-key ./publickey.pem

For example:

mix hex.repo set hexpm hexpm --url https://hexdemotest.jfrogdev.org/artifactory/api/hex/hc-hex-virtual --auth-key "Bearer cmVmdGtuOjAxOjE3Njc3MDUwOTg6dFFCMjlZTjl2SkGTUZadUQyelBv" --public-key ./publickey.pem

Note

Make sure that the publickey.pem key is pointing to the correct location in your project.