Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rosa-abf/rosa-build
base: 89a90bda02
...
head fork: rosa-abf/rosa-build
compare: cded4aaba3
Checking mergeability… Don't worry, you can still create the pull request.
  • 9 commits
  • 6 files changed
  • 0 commit comments
  • 3 contributors
View
2  Gemfile
@@ -14,7 +14,7 @@ gem 'omniauth-github'
gem 'cancan', '1.6.7' # 1.6.8 fail specs with strange error
gem 'ancestry', '~> 1.3.0'
-gem 'paperclip', '~> 3.3.1'
+gem 'paperclip', '~> 4.1.0'
gem 'resque', '~> 1.24'
gem 'resque-status', '~> 0.3.3'
gem 'resque_mailer', '~> 2.2'
View
22 Gemfile.lock
@@ -98,7 +98,10 @@ GEM
charlock_holmes (0.6.9.4)
chronic (0.10.2)
chunky_png (1.2.9)
- cocaine (0.4.2)
+ climate_control (0.0.3)
+ activesupport (>= 3.0)
+ cocaine (0.5.3)
+ climate_control (>= 0.0.3, < 1.0)
coderay (1.1.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
@@ -263,11 +266,10 @@ GEM
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
orm_adapter (0.5.0)
- paperclip (3.3.1)
+ paperclip (4.1.0)
activemodel (>= 3.0.0)
- activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
- cocaine (~> 0.4.0)
+ cocaine (~> 0.5.3)
mime-types
pg (0.14.1)
polyglot (0.3.3)
@@ -313,7 +315,7 @@ GEM
rdoc (3.12.2)
json (~> 1.4)
redcarpet (2.2.2)
- redis (3.0.7)
+ redis (3.0.6)
redis-actionpack (3.2.4)
actionpack (~> 3.2.0)
redis-rack (~> 1.4.4)
@@ -341,10 +343,10 @@ GEM
redis-namespace (~> 1.2)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
- resque-scheduler (2.5.1)
- redis (>= 3.0.0)
- resque (~> 1.25)
- rufus-scheduler (~> 2.0)
+ resque-scheduler (2.5.3)
+ redis (~> 3.0.4)
+ resque (~> 1.25.1)
+ rufus-scheduler (~> 2.0.24)
resque-status (0.3.3)
redisk (>= 0.2.1)
resque (~> 1.19)
@@ -504,7 +506,7 @@ DEPENDENCIES
omniauth-facebook
omniauth-github
omniauth-google-oauth2
- paperclip (~> 3.3.1)
+ paperclip (~> 4.1.0)
perform_later!
pg (~> 0.14.0)
puma
View
4 app/models/avatar.rb
@@ -10,7 +10,9 @@ class Avatar < ActiveRecord::Base
end
end
has_attached_file :avatar, styles: AVATAR_SIZES_HASH
- validates_inclusion_of :avatar_file_size, in: (0..MAX_AVATAR_SIZE), allow_nil: true
+ validates_attachment_size :avatar, less_than_or_equal_to: MAX_AVATAR_SIZE
+ validates_attachment_content_type :avatar, content_type: /\Aimage/
+ validates_attachment_file_name :avatar, matches: [ /(png|jpe?g|gif|bmp|tif?f)\z/i ]
attr_accessible :avatar
View
53 config/deploy.rb.sample
@@ -5,36 +5,31 @@ set :default_environment, {
'LANG' => 'en_US.UTF-8'
}
-#set :rake, "#{rake} --trace"
-
require 'rvm/capistrano'
require 'bundler/capistrano'
+require 'new_relic/recipes'
set :whenever_command, "bundle exec whenever"
-# require "whenever/capistrano"
require 'capistrano/ext/multistage'
-set :default_stage, "staging"
-# set :stages, %w(production) # auto readed
# main details
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
+set :rvm_ruby_string, 'ruby-2.1.0@rosa_build'
set :application, "rosa_build"
set(:deploy_to) { "/srv/#{application}" }
-set :user, "rosa"
+set :user, "user"
set :use_sudo, false
set :keep_releases, 3
+set :git_enable_submodules, 1
set :scm, :git
-set :repository, "git@github.com:uname/repository.git"
-set :deploy_via, :remote_cache
+set :repository, "git@abf.rosalinux.ru:abf/rosa-build.git"
require './lib/recipes/nginx'
-# require './lib/recipes/unicorn'
require 'puma/capistrano'
-#require './lib/recipes/bluepill'
set :workers_count, 4
require './lib/recipes/resque'
@@ -56,36 +51,21 @@ namespace :deploy do
task :symlink_pids, :roles => :app do
run "cd #{fetch :shared_path}/tmp && ln -nfs ../pids pids"
end
-
- # Speed up precompile (http://www.bencurtis.com/2011/12/skipping-asset-compilation-with-capistrano )
- # namespace :assets do
- # task :precompile, :roles => :web, :except => { :no_release => true } do
- # from = source.next_revision(current_revision)
- # if capture("cd #{latest_release} && #{source.local.log(from)} app/assets/ lib/assets/ vendor/assets/ | wc -l").to_i > 0
- # run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
- # else
- # logger.info "Skipping asset pre-compilation because there were no asset changes"
- # end
- # end
- # end
end
after "deploy:finalize_update", "deploy:symlink_all"
after "deploy:update_code", "deploy:migrate"
after "deploy:setup", "deploy:symlink_pids"
-# Bluepill
-#after "deploy:restart", "bluepill:restart" # "bluepill:processes:restart_dj" # "bluepill:restart"
-#after "deploy:start", "bluepill:start"
-#after "deploy:stop", "bluepill:stop"
-
# Resque
after "deploy:stop", "resque:stop"
+after "resque:stop", "resque:scheduler:stop"
after "deploy:start", "resque:start"
+after "resque:start", "resque:scheduler:start"
after "deploy:restart", "resque:restart"
+after "resque:restart", "resque:scheduler:restart"
after "deploy:restart", "deploy:cleanup"
-after :deploy, 'notify_rollbar'
namespace :rake_tasks do
Cape do
@@ -93,12 +73,17 @@ namespace :rake_tasks do
end
end
-task :notify_rollbar, :roles => :app do
- set :revision, `git log -n 1 --pretty=format:"%H"`
- set :local_user, `whoami`
- set :rollbar_token, 'rollbar_token'
- rails_env = fetch(:rails_env, 'production')
- run "curl https://api.rollbar.com/api/1/deploy/ -F access_token=#{rollbar_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user} >/dev/null 2>&1", :once => true
+namespace :puma do
+ desc 'Restart puma'
+ task :restart, :roles => :app, :on_no_matching_servers => :continue do
+ begin
+ stop
+ rescue Capistrano::CommandError => ex
+ puts "Failed to restart puma: #{ex}\nAssuming not started."
+ ensure
+ start
+ end
+ end
end
namespace :update do
View
3  config/initializers/mime_types.rb
@@ -14,7 +14,8 @@
["application/x-c++src", ['cpp', 'cc'], '8bit'],
["application/x-csharp", ['cs'], '8bit'],
["text/x-diff", ['diff'], '8bit'],
- ["text/x-markdown", ['md'], '8bit']
+ ["text/x-markdown", ['md'], '8bit'],
+ ["application/x-rpm", ['rpm'], '8bit']
].each do |type|
MIME::Types.add MIME::Type.from_array(type)
end
View
7 lib/modules/models/git.rb
@@ -7,11 +7,10 @@ module Git
extend ActiveSupport::Concern
included do
- validates_attachment_size :srpm, less_than: 500.megabytes
- validates_attachment_content_type :srpm, content_type: ['application/octet-stream', "application/x-rpm", "application/x-redhat-package-manager"], message: I18n.t('layout.invalid_content_type')
-
has_attached_file :srpm
- # attr_accessible :srpm
+
+ validates_attachment_size :srpm, less_than_or_equal_to: 500.megabytes
+ validates_attachment_content_type :srpm, content_type: ['application/octet-stream', "application/x-rpm", "application/x-redhat-package-manager"], message: I18n.t('layout.invalid_content_type')
after_create :create_git_repo
after_commit(on: :create) {|p| p.fork_git_repo unless p.is_root?} # later with resque

No commit comments for this range

Something went wrong with that request. Please try again.