diff options
author | Sytse Sijbrandij <sytse@dosire.com> | 2012-09-02 20:31:16 +0400 |
---|---|---|
committer | Sytse Sijbrandij <sytse@dosire.com> | 2012-09-02 20:39:50 +0400 |
commit | b80dd3d2422b59a1b241ccdae32140ca19f33dc3 (patch) | |
tree | ac364aae61f801ff1ea914bb60d9193418533f89 /doc | |
parent | eae41ad1df37cec184179df02fce7faa9434cb2a (diff) |
Non-interactive AWS install by running a single script.
Merge branch 'master' into non-interactive-aws-install
Conflicts:
doc/installation.md
Fix merge mess in installation.md
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/README.md | 2 | ||||
-rw-r--r-- | doc/api/milestones.md | 57 | ||||
-rw-r--r-- | doc/api/projects.md | 102 | ||||
-rw-r--r-- | doc/api/snippets.md | 100 | ||||
-rw-r--r-- | doc/development.md | 45 | ||||
-rw-r--r-- | doc/installation.md | 103 |
6 files changed, 218 insertions, 191 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index e01119661f0..53b4983ef47 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -27,4 +27,6 @@ The API uses JSON to serialize data. You don't need to specify `.json` at the en + [Users](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md) + [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md) ++ [Snippets](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/snippets.md) + [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md) ++ [Milestones](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/milestones.md) diff --git a/doc/api/milestones.md b/doc/api/milestones.md new file mode 100644 index 00000000000..f68d8eb7d58 --- /dev/null +++ b/doc/api/milestones.md @@ -0,0 +1,57 @@ +## List project milestones + +Get a list of project milestones. + +``` +GET /projects/:id/milestones +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project + +## Single milestone + +Get a single project milestone. + +``` +GET /projects/:id/milestones/:milestone_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `milestone_id` (required) - The ID of a project milestone + +## New milestone + +Create a new project milestone. + +``` +POST /projects/:id/milestones +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `milestone_id` (required) - The ID of a project milestone ++ `title` (required) - The title of an milestone ++ `description` (optional) - The description of the milestone ++ `due_date` (optional) - The due date of the milestone + +## Edit milestone + +Update an existing project milestone. + +``` +PUT /projects/:id/milestones/:milestone_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `milestone_id` (required) - The ID of a project milestone ++ `title` (optional) - The title of a milestone ++ `description` (optional) - The description of a milestone ++ `due_date` (optional) - The due date of the milestone ++ `closed` (optional) - The status of the milestone diff --git a/doc/api/projects.md b/doc/api/projects.md index ead31003512..d680b5d8597 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -204,108 +204,6 @@ Parameters: ] ``` -# Project Snippets - -## List snippets - -Not implemented. - -## Single snippet - -Get a project snippet. - -``` -GET /projects/:id/snippets/:snippet_id -``` - -Parameters: - -+ `id` (required) - The ID or code name of a project -+ `snippet_id` (required) - The ID of a project's snippet - -```json -{ - "id": 1, - "title": "test", - "file_name": "add.rb", - "author": { - "id": 1, - "email": "john@example.com", - "name": "John Smith", - "blocked": false, - "created_at": "2012-05-23T08:00:58Z" - }, - "expires_at": null, - "updated_at": "2012-06-28T10:52:04Z", - "created_at": "2012-06-28T10:52:04Z" -} -``` - -## Snippet content - -Get a raw project snippet. - -``` -GET /projects/:id/snippets/:snippet_id/raw -``` - -Parameters: - -+ `id` (required) - The ID or code name of a project -+ `snippet_id` (required) - The ID of a project's snippet - -## New snippet - -Create a new project snippet. - -``` -POST /projects/:id/snippets -``` - -Parameters: - -+ `id` (required) - The ID or code name of a project -+ `title` (required) - The title of a snippet -+ `file_name` (required) - The name of a snippet file -+ `lifetime` (optional) - The expiration date of a snippet -+ `code` (required) - The content of a snippet - -Will return created snippet with status `201 Created` on success, or `404 Not found` on fail. - -## Edit snippet - -Update an existing project snippet. - -``` -PUT /projects/:id/snippets/:snippet_id -``` - -Parameters: - -+ `id` (required) - The ID or code name of a project -+ `snippet_id` (required) - The ID of a project's snippet -+ `title` (optional) - The title of a snippet -+ `file_name` (optional) - The name of a snippet file -+ `lifetime` (optional) - The expiration date of a snippet -+ `code` (optional) - The content of a snippet - -Will return updated snippet with status `200 OK` on success, or `404 Not found` on fail. - -## Delete snippet - -Delete existing project snippet. - -``` -DELETE /projects/:id/snippets/:snippet_id -``` - -Parameters: - -+ `id` (required) - The ID or code name of a project -+ `snippet_id` (required) - The ID of a project's snippet - -Status code `200` will be returned on success. - ## Raw blob content Get the raw file contents for a file. diff --git a/doc/api/snippets.md b/doc/api/snippets.md new file mode 100644 index 00000000000..0cd29ce530b --- /dev/null +++ b/doc/api/snippets.md @@ -0,0 +1,100 @@ +## List snippets + +Not implemented. + +## Single snippet + +Get a project snippet. + +``` +GET /projects/:id/snippets/:snippet_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `snippet_id` (required) - The ID of a project's snippet + +```json +{ + "id": 1, + "title": "test", + "file_name": "add.rb", + "author": { + "id": 1, + "email": "john@example.com", + "name": "John Smith", + "blocked": false, + "created_at": "2012-05-23T08:00:58Z" + }, + "expires_at": null, + "updated_at": "2012-06-28T10:52:04Z", + "created_at": "2012-06-28T10:52:04Z" +} +``` + +## Snippet content + +Get a raw project snippet. + +``` +GET /projects/:id/snippets/:snippet_id/raw +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `snippet_id` (required) - The ID of a project's snippet + +## New snippet + +Create a new project snippet. + +``` +POST /projects/:id/snippets +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `title` (required) - The title of a snippet ++ `file_name` (required) - The name of a snippet file ++ `lifetime` (optional) - The expiration date of a snippet ++ `code` (required) - The content of a snippet + +Will return created snippet with status `201 Created` on success, or `404 Not found` on fail. + +## Edit snippet + +Update an existing project snippet. + +``` +PUT /projects/:id/snippets/:snippet_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `snippet_id` (required) - The ID of a project's snippet ++ `title` (optional) - The title of a snippet ++ `file_name` (optional) - The name of a snippet file ++ `lifetime` (optional) - The expiration date of a snippet ++ `code` (optional) - The content of a snippet + +Will return updated snippet with status `200 OK` on success, or `404 Not found` on fail. + +## Delete snippet + +Delete existing project snippet. + +``` +DELETE /projects/:id/snippets/:snippet_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `snippet_id` (required) - The ID of a project's snippet + +Status code `200` will be returned on success. + diff --git a/doc/development.md b/doc/development.md new file mode 100644 index 00000000000..55be2bc32f2 --- /dev/null +++ b/doc/development.md @@ -0,0 +1,45 @@ +## Development tips: + +### Start application in development mode + +#### 1. Via foreman + + bundle exec foreman -p 3000 + +#### 2. Via gitlab cli + + ./gitlab start + +#### 3. Manually + + bundle exec rails s + bundle exec rake environment resque:work QUEUE=* VVERBOSE=1 + + +### Run tests: + +#### 1. Packages + + # ubuntu + sudo apt-get install libqt4-dev libqtwebkit-dev + sudo apt-get install xvfb + + # Mac + brew install qt + brew install xvfb + +#### 2. DB & seeds + + bundle exec rake db:setup RAILS_ENV=test + bundle exec rake db:seed_fu RAILS_ENV=test + +### 3. Run Tests + + # All in one + bundle exec gitlab:test + + # Rspec + bundle exec rake spec + + # Cucumber + bundle exec rake cucumber diff --git a/doc/installation.md b/doc/installation.md index b6f1869b761..b3fe92bf4c6 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -119,7 +119,6 @@ Permissions: sudo chmod -R g+rwX /home/git/repositories/ sudo chown -R git:git /home/git/repositories/ - sudo chown gitlab:gitlab /home/git/repositories/**/hooks/post-receive #### CHECK: Logout & login again to apply git group to your user @@ -178,6 +177,11 @@ Permissions: sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production +#### Setup gitlab hooks + + sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive + sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive + Checking status: sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production @@ -196,6 +200,7 @@ Checking status: Resolving deltas: 100% (174/174), done. Can clone gitolite-admin?............YES UMASK for .gitolite.rc is 0007? ............YES + /home/git/share/gitolite/hooks/common/post-receive exists? ............YES If you got all YES - congrats! You can go to next step. @@ -239,42 +244,15 @@ You can login via web using admin generated with setup: sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D -Edit /etc/nginx/nginx.conf. In the *http* section add the following section of code or replace it completely with https://raw.github.com/dosire/gitlabhq/master/aws/nginx.conf - - upstream gitlab { - server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket; - } - - server { - listen YOUR_SERVER_IP:80; # e.g., listen 192.168.1.1:80; - server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com; - root /home/gitlab/gitlab/public; - - # individual nginx logs for this gitlab vhost - access_log /var/log/nginx/gitlab_access.log; - error_log /var/log/nginx/gitlab_error.log; - - location / { - # serve static files from defined root folder;. - # @gitlab is a named location for the upstream fallback, see below - try_files $uri $uri/index.html $uri.html @gitlab; - } - - # if a file, which is not found in the root folder is requested, - # then the proxy pass the request to the upsteam (gitlab unicorn) - location @gitlab { - proxy_redirect off; - - # you need to change this to "https", if you set "ssl" directive to "on" - proxy_set_header X-FORWARDED_PROTO http; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; +Add gitlab to nginx sites & change with your host specific settings - proxy_pass http://gitlab; - } - } + sudo cp /home/gitlab/gitlab/lib/support/nginx-gitlab /etc/nginx/sites-available/gitlab + sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab -Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN** to the IP address and fully-qualified domain name of the host serving GitLab. + # Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN** + # to the IP address and fully-qualified domain name + # of the host serving GitLab. + sudo vim /etc/nginx/sites-enabled/gitlab Restart nginx: @@ -282,60 +260,7 @@ Restart nginx: Create init script in /etc/init.d/gitlab: - #! /bin/bash - ### BEGIN INIT INFO - # Provides: gitlab - # Required-Start: $local_fs $remote_fs $network $syslog redis-server - # Required-Stop: $local_fs $remote_fs $network $syslog - # Default-Start: 2 3 4 5 - # Default-Stop: 0 1 6 - # Short-Description: GitLab git repository management - # Description: GitLab git repository management - ### END INIT INFO - - DAEMON_OPTS="-c /home/gitlab/gitlab/config/unicorn.rb -E production -D" - NAME=unicorn - DESC="Gitlab service" - PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid - RESQUE_PID=/home/gitlab/gitlab/tmp/pids/resque_worker.pid - - case "$1" in - start) - CD_TO_APP_DIR="cd /home/gitlab/gitlab" - START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" - START_RESQUE_PROCESS="./resque.sh" - - echo -n "Starting $DESC: " - if [ `whoami` = root ]; then - sudo -u gitlab sh -l -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS" - else - $CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS - fi - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - kill -QUIT `cat $PID` - kill -QUIT `cat $RESQUE_PID` - echo "$NAME." - ;; - restart) - echo -n "Restarting $DESC: " - kill -USR2 `cat $PID` - echo "$NAME." - ;; - reload) - echo -n "Reloading $DESC configuration: " - kill -HUP `cat $PID` - echo "$NAME." - ;; - *) - echo "Usage: $NAME {start|stop|restart|reload}" >&2 - exit 1 - ;; - esac - - exit 0 + cp /home/gitlab/gitlab/lib/support/init-gitlab /etc/init.d/gitlab Adding permission: |