There is many tools and tutorials shows how to setup SCM over HTTP. In my opinion the fastest and the cheapest way is to install Scm-Manager tool which allows to create, manage and expose over HTTP all common types of source code repositiories (Git, SVN).
Installation
This part of the guide comes from the official SCM-Manager bitbucket repository.
Important! For this tutorial purposes change default scm-manager HTTP port to 9092. The default scm-manager port is 8080 (default apache tomcat port). We are going to install few more tools based on apache tomcat, so to avoid conflicts, we will change every default ports configuration.
Debian linux family (i.a. Ubuntu)
Connect to your Ubuntu Server and run:
Important! This is temporary version of the script until SCM-Manager developers resolve their nexus server problem. The right script is below.
cd /tmp wget http://maven.scm-manager.org/nexus/content/repositories/releases/sonia/scm/scm-server/1.46/scm-server-1.46-all.deb sudo dpkg -i scm-server-1.46-all.deb
The right scritp – not working now!
echo "echo 'deb http://maven.scm-manager.org/nexus/content/repositories/releases ./' >> /etc/apt/sources.list" | sudo sh sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 D742B261 sudo apt-get update sudo apt-get install scm-server
Configuration
To change default SCM-Manager port 8080 to 9092 edit:
sudo nano /etc/default/scm-server
Find the line
# scm-server port PORT=8080
and change port number to 9092
# scm-server port PORT=9092
Restart service.
Starting, stopping and restarting SCM-Manager service in Ubuntu
sudo service scm-server start
sudo service scm-server stop
sudo service scm-server restart
Test SCM-Manager access
Verify the isntallation now. Open a browser and go:
http://SCM_MANAGER_IP:9092/
In my case:
http://192.168.1.56:9092/
LogIn. The default SCM-Manager login/password is : scmadmin/scmadmin
First Git repository
Add tutorial user
Go to users and add new user: tutorial/tutorial
Add permissions for All repositories to the tutorial user and press Enter key to save.
Create repository
Go to Repositories tab, Click add and create repository as below.
Your test repository is ready for work. Let’s checkout it somewhere.
cd /tmp git clone http://SCM_MANAGER_IP:9092/scm/git/test
In my case:
cd /tmp git clone http://192.168.1.56:9092/scm/git/test
Additionals
Post-Installation directory layout
/opt/scm-server # Main directory for scm-server installation /etc/default/scm-server # Default settings for scm-server /etc/init.d/scm-server # Start script for scm-server /var/cache/scm/work # Cache directory /var/log/scm # Logging directory /var/lib/scm # SCM-Manager home directory
Redhat linux family (i.a. CentOS)
Create a file SCM-Manager.repo in yum repos directory.
su - nano /etc/yum.repos.d/SCM-Manager.repo
Put the following content:
[scm-releases] name=SCM-Manager Releases baseurl=http://maven.scm-manager.org/nexus/content/repositories/releases enabled=1 protect=0 gpgcheck=0 metadata_expire=30s autorefresh=1 type=rpm-md
Save and exit to the shell. To install scm-server run as root:
yum install scm-server