Skip to content

Commit

Permalink
Remove CI guards
Browse files Browse the repository at this point in the history
  • Loading branch information
osowskit authored Feb 26, 2019
1 parent fcb21b0 commit 85db938
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end
# Default Rake Task
if ENV['CI']
task default: ['spec'] # 'features'
Bundler.require(:default, :test)
Bundler.require(:default, :test, :release)
else
task default: ['spec'] # 'features'
Bundler.require(:default, :test, :development, :release)
Expand All @@ -45,42 +45,39 @@ end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

unless ENV['CI']

# Release and Deployment
desc 'Builds the latest SDK docs locally'
task :docs do
FileUtils.rm_rf('doc')
YARD::CLI::CommandParser.run('--quiet')
end

namespace :docs do
git = Git.open(File.expand_path('../', __FILE__))
# Release and Deployment
desc 'Builds the latest SDK docs locally'
task :docs do
FileUtils.rm_rf('doc')
YARD::CLI::CommandParser.run('--quiet')
end

desc 'Builds and deploys the latest SDK docs'
task :deploy do
unless git.status.changed.empty?
puts 'Error! Cannot proceeed, you have pending changes.'.colorize(color: :red).bold
abort
end
FileUtils.rm_rf('doc')
YARD::CLI::CommandParser.run
namespace :docs do
git = Git.open(File.expand_path('../', __FILE__))

current_branch = git.branch.name
announce(:build, "updating v#{TwitterAds::VERSION} documentation") do
git.branch('gh-pages').checkout
FileUtils.rm_rf('reference')
FileUtils.mv('doc', 'reference')
git.add('reference')
git.commit("[docs] updating v#{TwitterAds::VERSION} documentation")
end
desc 'Builds and deploys the latest SDK docs'
task :deploy do
unless git.status.changed.empty?
puts 'Error! Cannot proceeed, you have pending changes.'.colorize(color: :red).bold
abort
end
FileUtils.rm_rf('doc')
YARD::CLI::CommandParser.run

announce(:push, "publishing v#{TwitterAds::VERSION} documentation") do
git.push('origin', 'gh-pages')
end
current_branch = git.branch.name
announce(:build, "updating v#{TwitterAds::VERSION} documentation") do
git.branch('gh-pages').checkout
FileUtils.rm_rf('reference')
FileUtils.mv('doc', 'reference')
git.add('reference')
git.commit("[docs] updating v#{TwitterAds::VERSION} documentation")
end

git.branch(current_branch).checkout
announce(:push, "publishing v#{TwitterAds::VERSION} documentation") do
git.push('origin', 'gh-pages')
end
end

git.branch(current_branch).checkout
end
end

0 comments on commit 85db938

Please sign in to comment.