Class: HerokuDeployment::Git
- Inherits:
-
Object
- Object
- HerokuDeployment::Git
- Defined in:
- lib/heroku_deployment/git.rb
Class Method Summary collapse
- .commit ⇒ Object
- .create_heroku_remote ⇒ Object
- .current_version ⇒ Object
- .pull ⇒ Object
- .pull_remote ⇒ Object
- .push ⇒ Object
- .push_remote ⇒ Object
Class Method Details
.commit ⇒ Object
25 26 27 |
# File 'lib/heroku_deployment/git.rb', line 25 def commit system %(git commit -m "Heroku deployment" -o #{HerokuDeployment::Config.commit_files.join(" ")} >/dev/null 2>&1) end |
.create_heroku_remote ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/heroku_deployment/git.rb', line 29 def create_heroku_remote remote = HerokuDeployment::Config.remote app = HerokuDeployment::Config.app if `git remote | grep #{remote}`.to_s == "" puts "Couldn't find '#{remote}' remote, added one now" system %(git remote add #{remote} [email protected]:#{app}.git) end end |
.current_version ⇒ Object
4 5 6 |
# File 'lib/heroku_deployment/git.rb', line 4 def current_version `git show HEAD | head -n 1`.split(" ").last.strip end |
.pull ⇒ Object
12 13 14 |
# File 'lib/heroku_deployment/git.rb', line 12 def pull system %(git pull >/dev/null 2>&1) end |
.pull_remote ⇒ Object
21 22 23 |
# File 'lib/heroku_deployment/git.rb', line 21 def pull_remote system %(git pull #{HerokuDeployment::Config.remote} master >/dev/null 2>&1) end |
.push ⇒ Object
8 9 10 |
# File 'lib/heroku_deployment/git.rb', line 8 def push system %(git push >/dev/null 2>&1) end |
.push_remote ⇒ Object
16 17 18 19 |
# File 'lib/heroku_deployment/git.rb', line 16 def push_remote create_heroku_remote system %(git push #{HerokuDeployment::Config.remote} master) end |