Merge branch 'master' of bitbucket.org:signum/debshots

Conflicts:
	README.Developer
	app/views/packages/details.slim
	bin/get-data-from-old-live-server.sh
This commit is contained in:
Christoph Haas 2015-06-14 12:36:58 +02:00
commit 4abfb29599
10 changed files with 63 additions and 12 deletions

View file

@ -43,7 +43,7 @@ end
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'debugger', group: [:development, :test]
# PostgreSQL support
gem 'pg'

View file

@ -72,6 +72,12 @@ GEM
jquery-cookie-rails
jquery-rails
debug_inspector (0.0.2)
debugger (1.6.8)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.3.5)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.8)
erubis (2.7.0)
execjs (2.5.2)
fancybox2-rails (0.2.8)
@ -250,6 +256,7 @@ DEPENDENCIES
bzip2-ruby!
coffee-rails (~> 4.1.0)
cookies_eu
debugger
fancybox2-rails (~> 0.2.8)
foundation-rails
guard-minitest

View file

@ -82,4 +82,41 @@ properly unless the separate model validation is in place.
Deployment
----------
sudo apt-get install libyaml-dev libbz2-dev
To prepare your computer to run Debshots 2.x either for development
or production you need to…
- unpack the project onto your disk somewhere
- install Ruby 2.0.0 via rvm (see http://rvm.io/)
- install the library header packages so that the required Ruby gems
can be compiled:
sudo apt-get install libbz2-dev libpq-dev libyaml-dev
- install a PostgreSQL database:
sudo apt-get install postgresql
- edit the PostgreSQL authentication configuration at
/etc/postgres/.../pg_hba.conf to allow password-based logins
from localhost. Change the line starting with *local* to read:
local all all md5
- create a user and databases
- sudo su - postgres
- createuser -s -P debshots
- createdb debshots
- for development only:
- sudo su - postgres
- createdb debshots_dev
- migrate the data from the Debshots 1.x based production server:
- bin/get-data-from-old-live-server.sh
- install all Ruby gems required to run the application:
- gem install bundle
- bundler
- run database migrations for development
- RAILS_ENV=development rake db:migrate
- import long description information for the packages into development database
- RAILS_ENV=development rake debshots:update_longdescription_from_deb_repos
- run database migrations for production
- RAILS_ENV=production rake db:migrate
- RAILS_ENV=production rake debshots:update_longdescription_from_deb_repos
- import long description information for the packages into production database
- prepare the static assets (CSS, JS) for production
- RAILS_ENV=production rake assets:precompile
- run the production web server
- RAILS_ENV=production rails s

View file

@ -151,7 +151,7 @@ html, body {
img
{
box-shadow: 0 0 10px 0px #888888;
filter: drop-shadow( 0px 0px 5px #888888 );
}
}

View file

@ -42,7 +42,7 @@ class Screenshot < ActiveRecord::Base
# Return Debshots 1.x path to allow migration of images into Paperclip filesystem schema
def image_url(size)
'#{Rails.configuration.images_path_prefix}/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png'
"#{Rails.configuration.images_path_prefix}/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png"
end

View file

@ -15,6 +15,8 @@ html
body
// TODO: move topbar somewhere else than packages
= render 'layouts/topbar'
#messages
= render 'layouts/messages'
#content
= yield
= render 'layouts/footer'

View file

@ -19,13 +19,13 @@
onclick="return confirm('Really delete the screenshot?');"
] Delete screenshot
- else
img src='/images/dummy/no-screenshots-available.svg' width='100%'
.row.listview
img src='/images/dummy/no-screenshots-available.svg' width='100%'
// TODO: Enable comments in a later version
// = partial '/package/comments'
.small-5.medium-5.columns
= render 'layouts/messages'
.bigpanel
p.subtitle Details
// TODO: split long_description by <p> tags

View file

@ -101,8 +101,7 @@
p
' Whether you are a developer or not - we appreciate if you upload screenshots.
' See if your favorite package does not yet have a screenshot and
a href=upload_package_path upload one
' .
' upload one.
h2 Statistics

View file

@ -15,13 +15,19 @@ rsync -v root@screenshots.debian.net:/home/debshots/debshots.sql /tmp
echo Dropping existing database
set +e
psql -h $DB_HOST postgres debshots -c 'drop database debshots'
psql -h $DB_HOST postgres debshots -c 'drop database debshots_dev'
psql -h $DB_HOST postgres debshots -c 'drop database debshots_test'
set -e
echo Creating new database
psql -h $DB_HOST postgres debshots -c 'create database debshots owner debshots'
psql -h $DB_HOST postgres debshots -c 'create database debshots_dev owner debshots'
psql -h $DB_HOST postgres debshots -c 'create database debshots_test owner debshots'
echo Restoring PostgreSQL dump
psql -h $DB_HOST debshots debshots < /tmp/debshots.sql
psql -h $DB_HOST debshots_dev debshots < /tmp/debshots.sql
psql -h $DB_HOST debshots_test debshots < /tmp/debshots.sql
echo Unpacking screenshots tarball
#cd ../public

View file

@ -9,8 +9,8 @@ development:
adapter: postgresql
database: debshots_dev
username: debshots
password: GonwannEn0
host: localhost
password: shootme
host: torf
pool: 5
timeout: 5000
@ -21,8 +21,8 @@ test:
adapter: postgresql
database: debshots_test
username: debshots
password: GonwannEn0
host: localhost
password: shootme
host: torf
pool: 5
timeout: 5000