Jfrog Notes
Jfrog Notes
Types of repositories
Installation of Jfrog artifactory
Manual Deployment of Artifacts via GUI
Maven Integration with jfrog artifactory
Artifact upload download:
* How to upload the artifacts to snapshot repository?
* How to upload the artifacts to release repository?
* How to download the artifacts from jfrog repositories?
Troubleshooting steps for Jfrog artifactory
Directory structure of Jfrog artifactory
Jfrog Administration
===================================================================================
========================================
Jfrog artifactory is an repository management tool or universal management tool
used for storing the artifacts.
Jfrog artifactory is a repository manager that supports all available software
package types like jar, war, ear, rar, bar etc
Jfrog is a repository Management tool or universal artifactory management tool.
Jfrog Artifactory is a repository manager that supports all available software
package types.
Jfrog Artifactory is a tool used in devops methodology to store artifacts.
Jfrog provides proper tracking of the artifacts version like who
uploaded/deleted/downloaded and at what time and date.
Jfrog provides an mechanism like git version control system called SHA(secure
hashing alogrithm ) which provides commit_id for storing the artifacts without
backup's bec with commit_id we can record the changes of every new uploads.
Jfrog also provides proper user management with access restricts for tracking and
securing the artifacts so that we can easily share artifacts to other securely.
Jfrog also allows us to store the artifact in proper format of Maven.
===================================================================================
================================
Why Jfrog ?
===================================================================================
================================
Developer -> develops/writes the code -> push the code to github
Devops -> Maven build -> compile, test, packages
-> Generate artifacts(.jar/.war)
-> Sonarqube -> Code scanning and code inspection for checking
vulnerabilities and bugs, duplication of code etc
-> Tomcat -> Launching the application for deploying the artifacts.
-> Storage for Artifacta(JAR/WAR)?
Ecommerce website:
* login feature
* logout feature
* payment feature
* Acknowledgment feature
* Product catalog feature
.
.
.
.
.
.
===================================================================================
==
Challenges:
===================================================================================
==
1. Storage space is required for storing artifacts which again incurs storage cost,
we need mechanism to reduce cost.
2. Proper version control system for tracking the Artifacts - who/when/what-
uploaded and deleted.
3. Proper downlaod and uplaod speed to deploy the artifact.
4. Storing the artifact should be in proper format bec artifacts is built in maven
format.
===================================================================================
=======================================
Types of repositories:
===================================================================================
========================================
1. Local : Local repositories are physical , locally managed respositories into
which we can deploy or store the artifacts.
Artifacts deployed in local repositories can be snapshot, release, common
artifacts, plugins etc.
===================================================================================
=======================================
Installation of Jfrog artifactory:
===================================================================================
=======================================
Minimum requirement of Server :
OS image: Redhat
Instance type: t2.medium - 2 core CPU, 4 GB RAM (OR) t2.large - 4 core cpu & 8
GB
Harddisk : 10 GB
Security groups:
8081 -> custom TCP -> anywhere 0.0.0.0/0 // Default port for Jfrog CLI
8082 -> custom TCP -> anywhere 0.0.0.0/0 // Default port for Jfrog GUI
80 -> HTTP -> anywhere 0.0.0.0/0 // hit url http://public-ip:8081
22 -> SSH -> anywhere 0.0.0.0/0 //login into machine
Custom ICMP IPV4 -> anywhere 0.0.0.0/0 // if any blocking port are there,
it will unblock us!!
(OR)
https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/
jfrog-artifactory-oss/?
_gl=1*btirnf*_ga*MTUwNTc2MzQzNi4xNjk3NTYxOTk4*_ga_SQ1NR9VTFJ*MTcwMTIxODgyNS42LjEuMT
cwMTIxOTUxOC4wLjAuMA..*_fplc*RE51TTkwQlMwdTlMWXZqWkk3MzdQS3U2TUJEVEV0OHpjejJCYXFJWV
g5b0QzWiUyQjRoM29jQk5SemludVBNWVEzQXN2OUkxOTBHbDNsbSUyQlRlUFg4Nm1PU1hRdXJweHVUdnpWb
HMxNlIlMkI0WSUyQnVSWHkxUnpWRlRRQjJ0dUQ3NXclM0QlM0Q.
username: admin
password : Admin@123
===================================================================================
=========================================
Manual Deployment of Artifacts via GUI:
===================================================================================
==========================================
Download in machine : wget
https://github.com/AKSarav/SampleWebApp/raw/master/dist/SampleWebApp.war
General tab -> Artifactory -> Artifacts -> select repository -> Deploy\
===================================================================================
==========================================
Maven integration with Jfrog:
===================================================================================
========================================
1. Add Credentials of Jfrog in settings.xml
======================================
xml - extended markup language
xml ns - xml namespce
=========================================================================
vi ~/.m2/settings.xml
<servers>
<server>
<id>jfrog-snapshots</id>
<username>admin</username>
<password>Admin@123</password>
</server>
<server>
<id>jfrog-releases</id>
<username>admin</username>
<password>Admin@123</password>
</server>
</servers>
</settings>
2. pom.xml :-
vi /opt/Hello-World-Code/webapp/pom.xml
<distributionManagement>
<snapshotRepository>
<id>jfrog-snapshots</id>
<url>http://3.141.6.31:8082/artifactory/local-snasphot-repo/</url>
</snapshotRepository>
<repository>
<id>jfrog-releases</id>
<url>http://3.141.6.31:8082/artifactory/local-release-repo/</url>
</repository>
</distributionManagement>
3. Upload to Jfrog:
How to upload artifact to maven snapshots repos via command line ?
a. Snapshot version upload to Jfrog.
if pom.xml -> <version>1.0-SNAPSHOT</version> then go to <snapshotRepository>
block and execute in pom.xml
cd /opt/Hello-World-Code/webapp
mvn clean deploy
===================================================================================
=========================================
How to download artifacts from Jfrog artifactory virtual repository to local
repository?
===================================================================================
=======================================
1. Create repo : maven-licence-repo ==> repository type maven2(hosted)
<dependency>
<groupId>webapp.app</groupId>
<artifactId>SampleWebApp</artifactId>
<version>5.0</version>
<type>war</type>
</dependency>
<repositories>
<repository>
<id>jfrog-virtual</id>
<url>http://18.118.46.20:8082/artifactory/maven-licence-repo/</url>
</repository>
</repositories>
5. Add in settings.xml
vi ~/.m2/settings.xml or /opt/maven/conf/settings.xml
===================================================================================
===========================
Troubleshooting steps for Jfrog artifactory:
===================================================================================
===========================
1. Hit the URL: http://Public:8082
(OR)
cd /app/jfrog/app/bin
./artifactoryctl status
(OR)
cd /app/jfrog/app/bin
./artifactoryctl restart
2. /app/jfrog/var: log
data
===================================================================================
====================================
Jfrog Administration:
===================================================================================
======================================