This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec cap production deploy -s domain='xxx@xxx' -s branch='develop' -s rvm_bin_path='/home/cpc-system/.rvm/bin' -s deploy_to='/home/cpc-system/apps/tarif-edit' -s rvm_path='/home/cpc-system/.rvm' -s repository='ssh://git@red/omg-tarif-edit.git' -s deploy_via=copy -s git_shallow_clone=1 | |
* executing `production' | |
triggering start callbacks for `deploy' | |
* executing `multistage:ensure' | |
* executing `deploy' | |
* executing `deploy:update' | |
** transaction: start | |
* executing `deploy:update_code' | |
executing locally: "git ls-remote ssh://git@red/omg-tarif-edit.git develop" | |
command finished in 11884ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "rubygems" | |
require "pry" | |
$DEBUG = false | |
def hardsub(source_file, sub_file, sub_encoding, position, result_file) | |
command = %Q{ mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000 #{source_file} \ | |
-subwidth 75 -subcp #{sub_encoding} -subfont-text-scale 3 -sub #{sub_file} \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
full_git_commit() | |
{ | |
git add . && git commit -a -m "$1" && git push | |
} | |
alias fgc=full_git_commit | |
# use `fgc 'my commit message'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should calculate with real tarif" do | |
time = Time.local(2011, 5, 6, 13, 00, 0) | |
Timecop.freeze(time) | |
real_tarif_settings = YAML.load(File.read(File.join(RACK_ROOT, 'spec', 'support', 'unit_tarif.yml'))) | |
real_calc_module = CalculationModule.create!(:slug => 'real_tariff', :settings => real_tarif_settings) | |
real_tarif = Tarif.create!(:name => 'real_tariff', :starts_at => 1.year.ago) | |
CalculationRule.make!(:calculation_module => real_calc_module, :service => Service.find(ServerConfig.service_autorun_id), :tarif => real_tarif) | |
computer = Computer.make!(:computer_class => ComputerClass.find('b12d1111-50c0-11e1-95f6-0023df7d4b7e')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should calculate with real tarif" do | |
time = Time.local(2011, 5, 6, 13, 00, 0) | |
Timecop.freeze(time) do | |
real_tarif_settings = YAML.load(File.read(File.join(RACK_ROOT, 'spec', 'support', 'unit_tarif.yml'))) | |
real_calc_module = CalculationModule.create!(:slug => 'real_tariff', :settings => real_tarif_settings) | |
real_tarif = Tarif.create!(:name => 'real_tariff', :starts_at => 1.year.ago) | |
CalculationRule.make!(:calculation_module => real_calc_module, :service => Service.find(ServerConfig.service_autorun_id), :tarif => real_tarif) | |
computer = Computer.make!(:computer_class => ComputerClass.find('b12d1111-50c0-11e1-95f6-0023df7d4b7e')) | |
# свой сервис |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function detect_git_branch { | |
local git_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/") | |
[ "$git_branch" != "" ] && echo " ($git_branch) " | |
} | |
function detect_rvm_name { | |
local gemset=$(echo $GEM_HOME | awk -F'/' '{print $NF}') | |
[ "$gemset" != "" ] && echo "($gemset)" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias b='bundle' | |
alias be='b exec' | |
alias ber='b exec rake' | |
alias beu='b exec uniqfrd' | |
alias bi='b install --path vendor' | |
alias bil='bi --local' | |
alias binit='bi && b package && echo '\''vendor/ruby'\'' >> .gitignore' | |
alias bu='b update' | |
alias create-repo='touch .gitignore && git add .gitignore && git commit -m '\''Created repo'\'' && git checkout -b develop' | |
alias g='git' |
NewerOlder