mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-30 14:31:12 +00:00
22 lines
549 B
Ruby
22 lines
549 B
Ruby
|
namespace :ci do
|
||
|
task :deploy do
|
||
|
require 'rubygems'
|
||
|
require 'capistrano/all'
|
||
|
require 'capistrano/setup'
|
||
|
require 'capistrano/deploy'
|
||
|
|
||
|
if ci_branch = ENV['TRAVIS_BRANCH']
|
||
|
BRANCH_MAP = {
|
||
|
# 'master' => 'production'
|
||
|
'develop' => 'staging'
|
||
|
}
|
||
|
|
||
|
if BRANCH_MAP.include?(ci_branch)
|
||
|
Capistrano::Application.invoke(BRANCH_MAP[ci_branch])
|
||
|
Capistrano::Application.invoke("deploy")
|
||
|
end
|
||
|
else
|
||
|
raise "Failed to deploy: Rake task called outside of CI environment"
|
||
|
end
|
||
|
end
|
||
|
end
|