Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Monday, June 18, 2012

Use Bitnami Redmine for deploy of my redmine version

I need to deploy Redmine on windows ,to minimize work and issues, I use Bitnami Redmine for windows installer.
I will update the installtion to use my own custom version of redmine , that will be stored on a remote git branch (currently github).

The steps

1. Install redmine stack from bitnami , make sure that every thing is working (browser), then stop all services of Redmine stack.
2.  Goto BitNami\RedmineStack\apps\redmine folder , rename the "htdocs" folder to "htdocs_org" and create a new blank "htdocs" folder.
3. In the blank "htdocs" folder , we will init a new git repo and link it to our remote branch by doing :

cd htdocs
git init
git remote add -t my_work -f origin git://github.com/haimlankry/redmine-1.git
git checkout my_work


At this stage you should have a full redmine project from your git, now will copy some data from the original folder.


4. Copy the folowing folders and files from "htdocs_org" to "htdocs" in the relevant location
root: .bundle, bin , Gemfile.lock 
config/database.yml configuration.rb and additional_environment.rb
tmp/ cache sessions and sockets folder
config\initializers\secret_token.rb

5. Add to the Gemfile the line: gem 'thin' #(if it is not allready in the gemfile)

Test your settings buy starting the thin server, (takes a while on windows) :
start mysql using the service manager utility (or any other way) then type:
bundle exec thin start -e production -p 3001 --prefix /redmine

This should start a thin webserver listens on port 3001 , you can check on the browser for :
http://localhost:3001/redmine
This should result in the redmine home page.

Thats it , now you can develop on your machine , push to git hub, then "git clone" on deploy to get latest update.

Thursday, June 7, 2012

Git And ssh on server

Adding a user to existing server to have git access sup

$ sudo groupadd developers
$ sudo useradd -G developers -d /home/john -m -s /bin/bash john
$ sudo useradd -G developers -d /home/andrew -m -s /bin/bash andrew

$ sudo passwd john
$ sudo passwd andrew

connect users toserver withut pssword , using public key that is in the .ssh/authorized_keys ander the home user folder
Verify that user is owner of /home/username and .ssh and authrization_keys

cd .ssh
chmod og-rw authorized_keys
chmod a-x authorized_keys
cd ~
chmod 700 .ssh
the user public key should have strict access so we need to :
chmod u+rwx /home/ec2-user/.ssh/ -R
chmod a-rwx /home/ec2-user/.ssh/ -R ??? not sure

Monday, June 4, 2012

Add local git repo to remote server

On server with a folder named "repos" accessible for the user

mkdir -p repositories/project.git
cd repositories/project.git
git init --bare --shared=group
chgrp -R <developers group> .


On local machine:

git remote add origin haim@IPADDRESS:repos/project.git
git push -u origin master