If you are developing software, you’ll most likely use a build-management tool like Ant or Maven. In the following guide I want to explain how to install the Artifactory Maven Repository Manager, set it up and configure it as a service which can be administered with svcadm.

Basic installation

There are some basic requirements for the installation. If you’re running a default OpenSolaris installation, everything should be fine. Merely in a zone you’ll most likely need some additional software which can be install via pkg.

root@test:~# pkg install wget jdk unzip

The next steps are to create a user for artifactory (we don’t want to run it as root), download the software and create the required folders.

First the new user artifact:

root@test:~# mkdir -p /export/home
root@test:~# useradd -d /export/home/artifact -s /usr/bin/false -m artifact

Then we need to find current version on http://sourceforge.net/projects/artifactory/files/artifactory/ and wget it. We will install artifactory into /opt/artifactory which has to be created first.

root@test:/opt/artifactory# mkdir -p /opt/artifactory
root@test:/opt/artifactory# cd /opt/artifactory/
root@test:/opt/artifactory# wget http://garr.dl.sourceforge.net/project/artifactory/artifactory/2.3.4/artifactory-2.3.4.zip
--2011-07-29 19:28:41--  http://garr.dl.sourceforge.net/project/artifactory/artifactory/2.3.4/artifactory-2.3.4.zip
idn_decode failed (9): `System iconv failed'
Resolving garr.dl.sourceforge.net... 193.206.140.34, 2001:760:ffff:b0::34
idn_decode failed (9): `System iconv failed'
Connecting to garr.dl.sourceforge.net|193.206.140.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 37505566 (36M) [application/zip]
Saving to: `artifactory-2.3.4.zip'

100%[========================================================================>] 37,505,566   702K/s   in 53s

2011-07-29 19:29:34 (694 KB/s) - `artifactory-2.3.4.zip' saved [37505566/37505566]

root@test:/opt/artifactory# unzip artifactory-2.3.4
Archive:  artifactory-2.3.4.zip
   creating: artifactory-2.3.4/
   creating: artifactory-2.3.4/lib/
   creating: artifactory-2.3.4/etc/
   creating: artifactory-2.3.4/etc/repo/
   ...
root@test:/opt/artifactory# rm artifactory-2.3.4.zip
root@test:/opt/artifactory# mkdir artifactory-2.3.4/logs
root@test:/opt/artifactory# ln -s artifactory-2.3.4 current
root@test:/opt/artifactory# chown -R artifact:other /opt/artifactory/current
root@test:/opt/artifactory# chown -R artifact:other /opt/artifactory/artifactory-2.3.4

Configuration

Now we installed artifactory and need to configure it. The user-guide, a wiki and further information can be found on http://www.jfrog.com/community.php. This guide should be narrowed to the basic config.
There are several places to put the config, the best is /etc/artifactory/default as a update of artifactory will not overwrite the old config. There is a basic default config available in the artifactory package which we use and modify.

root@test:/opt/artifactory# mkdir /etc/artifactory
root@test:/opt/artifactory# chown -R artifact:other /etc/artifactory
root@test:/opt/artifactory# sed 's|#export JAVA_HOME=/opt/java/1.6.0|export JAVA_HOME=/usr/jdk/latest|g' /opt/artifactory/current/bin/artifactory.default > /etc/artifactory/default

Your /etc/artifactory/default should now look like this:

root@test:/opt/artifactory# cat /etc/artifactory/default

#!/bin/sh

#Default values
#export ARTIFACTORY_HOME=/opt/artifactory/current
#export ARTIFACTORY_BIN_HOME=/var/lib/artifactory
#export TOMCAT_HOME=/opt/artifactory/tomcat
#export ARTIFACTORY_USER=artifactory
export JAVA_HOME=/usr/jdk/latest
#export ARTIFACTORY_CONSOLE=${ARTIFACTORY_HOME}/logs/consoleout.log
#export CATALINA_PID=/var/lib/artifactory/artifactory.pid

export JAVA_OPTIONS="-server -Xms1g -Xmx1g -Xss256k -XX:PermSize=128m -XX:MaxPermSize=128m -XX:NewSize=384m -XX:MaxNewSize=384m"

Artifactory as Solaris Service

The final step is to integrate artifactory into Solaris’ Service Management Facility (smf). This requires a XML config file which describes the artifactory-service.
The required file can be found here:
artifactory-smf.xml

root@test:/opt/artifactory# cd /tmp/
root@test:/tmp# wget http://www.dev-eth0.de/wp-content/uploads/2011/07/artifactory-smf.xml
root@test:/tmp# svccfg import -V artifactory-smf.xml

Now we have installed artifactory as a Solaris Service and can start and stop it with the svcadm command and check it’s status with svcs.

Commands:

svcadm enable artifactory
svcadm disable artifactory
svcadm restart artifactory

The following commands will start artifactory and check if everything is ok and running.

root@test:/tmp# svcadm enable artifactory
root@test:/tmp#  svcs -x artifactory
svc:/application/artifactory:artifactory (Artifactory - Maven build artifact manager)
 State: online since Fri Jul 29 19:40:44 2011
   See: http://www.jfrog.com/products.php
   See: /var/svc/log/application-artifactory:artifactory.log
Impact: None.

That’s it, the service is up and running, now we can access the WebGui on Port 8081:

http://yourServer:8081/artifactory

It should look like this
artifactory 300x132 Artifactory Maven Repository Manager with OpenSolaris


Related Posts



Ein Kommentar bis “Artifactory Maven Repository Manager with OpenSolaris”

  1. [...] the installation of Artifactory, the next step is a continuous integration (CI) system. Jenkins is a fork of the Hudson CI server, [...]

Eine Antwort schreiben