Library Safety Manager Open Source Plugin For Artifactory
- Deploy the worker, see "How to deploy the worker"
- Deploy test repositories by going to the
support
folder and runningnpm run repositories
- Go to the
worker
directory - Make sure the
jf
client is installed - Run
jf login
and login - Run
npm run deploy
to deploy the worker
- Make sure the worker is active (it autodisables itself every time you push an update, see the "How to activate an Artifactory Worker" section)
- Create repository or find artifact
- Use the technology to fetch the package (see the "How to fetch package via Artifactory" section)
- In the Artifactory platform, select Administration -> Repositories (left hand side menu) -> Create a repository (green button, right side) -> Local for private npm packages you made, Remote for public like React or something you didnt make. -> Select the package manager (usually docker or npm or whatever matches the technology you are using) -> Set repository key to whatever you want to name the repository (usually the project name). Leave all other fields empty if you dont know what to put there. Make sure not to touch the URL field unless you know its incorrect and know what to put there. -> Create (remote / local) repository (button with green stroke bottom right)
cd support
npm install
npm run repositories
- Run
npm install
to install all development dependencies - Create a
.env
file in thesrc
directory - Add the following credentials to the
.env
file:
JFROG_USERNAME=<your_jfrog_username>
JFROG_TOKEN=<your_jfrog_token>
JFROG_ID=<your_jfrog_id>
- Ensure the worker is deployed (check that the code matches the remote if you are unsure)
- In the Artifactory platform, select Administration
- Click Workers (left side menu at the very bottom)
- Find the worker in question
- Ensure "Enable" is toggled on
- Click the three dots at the right side of the worker
- Click "Edit"
- Ensure that it still says "Enabled" on the right side besides the gear icon
- Click the gear icon
- Click on the pencil in the "Repositories" box to edit the repositories filter
- Click on the green double right arrow icon (>>)
- Ensure all repositories are now active for the filter
- Click ok to save the filter
- Click ok again to save the updated worker settings
- Click "Save" to save the worker changes
- Ensure the worker is active and that the events are up to date (check the metadata)
- You have to use a new package, previous packages are cached and will not be refetched even if you update the worker.
The worker functions with the following package managers / technologies:
- docker
- gradle
- maven
- npm
- pip
- ruby
- huggingface (via pip)
- terraform
- bower
- debian
- alpine
- cocoapods
- go
- swift
- ansible
- generic
- oci
- helm
- rust
We are currently working on:
- chef
- sbt
- ivy
NB: Remember to replace the ID both in the login command and configuration file.
- Login with
terraform login <id>.jfrog.io
- Add a configuration file
.terraformrc
with the following configuration:
provider_installation {
direct {
exclude = ["registry.terraform.io/*/*"]
}
network_mirror {
url = "https://<id>.jfrog.io/artifactory/api/terraform/terraform/providers/"
}
}
- Run
terraform init
-- todo
- Add it to the
~/.gemrc
file using the following command:gem source -a https://<username>:<token>@trial9apndc.jfrog.io/artifactory/api/gems/ruby/
- If anonymous access is allowed
gem source -a https://<id>.jfrog.io/artifactory/api/gems/ruby/
can be used. - To view a list of sources and their resolutions use
gem sources
. - To store the credential in
~/.gem/credentials
usecurl -u <email>%40<email_domain>:<token> https://<id>.jfrog.io/artifactory/api/gems/ruby/api/v1/api_key.yaml > ~/.gem/credentials
gem install <PACKAGE>
or explicitlygem install <PACKAGE> --source https://trial9apndc.jfrog.io/artifactory/api/gems/ruby
For Go you need to have a virtual repo and a remote repo with these settings:
Remote repo:
- Allow Artifact Content Browsing
- Store Artifacts Locally
- Synchronize Properties
- Bypass HEAD Requests
- Block Mismatching Mime Types
Important! Git Provider have to be Artifactory
Virtual repo:
- Need to add the remote repo to the virtual repo
- Have a working repo with
go.mod
andmain.go
"test-go": "dotenv -e test.env -- bash -c \"export GOPROXY=https://$JFROG_USERNAME:$JFROG_TOKEN@$JFROG_ID.jfrog.io/artifactory/api/go/go-test; go get github.com/gin-gonic/[email protected]\""
Or runnpm run go-test