From b4ff6932be20f8dba5094206e7bc8b716fc96add Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 14 Nov 2023 02:36:24 +0300 Subject: [PATCH] Add JFrog OAuth and token examples to README --- jfrog-oauth/README.md | 24 ++++++++++++++++++++++++ jfrog-token/README.md | 17 ++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/jfrog-oauth/README.md b/jfrog-oauth/README.md index 1cead1c..dfdd199 100644 --- a/jfrog-oauth/README.md +++ b/jfrog-oauth/README.md @@ -32,3 +32,27 @@ module "jfrog" { ## Prerequisites - Coder [`external-auth`](https://docs.coder.com/docs/admin/external-auth/) configured with Artifactory. This requires a [custom integration](https://jfrog.com/help/r/jfrog-installation-setup-documentation/enable-new-integrations) in Artifactory with **Callback URL** set to `https:///external-auth/jfrog/callback`. + +## Examples + +Configure the Python pip package manager to fetch packages from Artifactory while mapping the Coder email to the Artifactory username. + +```hcl +module "jfrog" { + source = "https://registry.coder.com/modules/jfrog-oauth" + agent_id = coder_agent.example.id + jfrog_url = "https://jfrog.example.com" + auth_method = "oauth" + username_field = "email" + package_managers = { + "pypi": "pypi" + } +} +``` + +You should now be able to install packages from Artifactory using both the `jf pip` and `pip` command. + +```shell +jf pip install requests +pip install requests +``` diff --git a/jfrog-token/README.md b/jfrog-token/README.md index ce1f7b7..fc3c248 100644 --- a/jfrog-token/README.md +++ b/jfrog-token/README.md @@ -19,9 +19,9 @@ module "jfrog" { jfrog_url = "https://YYYY.jfrog.io" artifactory_access_token = var.artifactory_access_token # An admin access token package_managers = { - "npm": "npm-remote", - "go": "go-remote", - "pypi": "pypi-remote" + "npm": "npm", + "go": "go", + "pypi": "pypi" } } ``` @@ -54,3 +54,14 @@ module "jfrog" { } } ``` + +You should now be able to install packages from Artifactory using both the `jf npm`, `jf go`, `jf pip` and `npm`, `go`, `pip` command. + +```shell +jf npm install prettier +jf go get github.com/golang/example/hello +jf pip install requests +npm install prettier +go get github.com/golang/example/hello +pip install requests +```