require 'picsolve_docker_builder/composer/composer' namespace :compose do desc 'Deploy to composition - jenkins task' task :jenkins do fail 'Not in a Jenkins environment' \ if ENV['BUILD_NUMBER'].nil? Rake::Task[:'docker:deploy'].invoke end task :jenkins_fake do ENV['BUILD_NUMBER'] = '1234' Rake::Task[:'docker:jenkins'].invoke end task :prepare do @docker_compose ||= PicsolveDockerBuilder::Composer::Composer.new @docker_compose.prepare end desc 'Deploy to composition' task deploy: :prepare do stage = ENV['STAGE'] || 'CI' @docker_compose.stage = stage @docker_compose.deploy end end