Sha256: cd2a4f4e3fa1910af03516010925b11893009eed2818eb2b8faef4f698cac579

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

require "yaml"
require "json"
require "groundskeeper"

desc "Sets up project details."
# rubocop:disable Metrics/BlockLength
task :before_run do
  application = %x(basename `git rev-parse --show-toplevel`).strip!
  unless Groundskeeper::Project.available_applications.include? application
    raise "must be inside application repo (currently in #{application}). " \
          "available applications: " +
          Groundskeeper::Project.available_applications
  end

  project = Groundskeeper::Project.build(application)
  set :project, project

  set :application_name, application
  set :domain, project.full_dns(fetch(:stage))
  set :user, "deploy"
  set :repository, project.repo_url
  set :deploy_to, project.deploy_to
  set :forward_agent, true
  set :bundle_path, "bundle"

  set :rvm_ruby_version, project.rvm_ruby_version
  set :rvm_type, :system

  # On each deploy, prompt for the tag
  puts "Looking up tags for project #{application}... (#{project.repo_url})"
  tags = project.tags
  raise "There must be a tagged release prior to deploying." if tags.count.zero?

  tag = ENV["tag"]
  unless tags.include? tag
    raise "Tag \"#{tag}\" not found. Available tags:\n #{tags.join("\n")}"
  end

  set :branch, "master"
  set :tag, "tags/#{tag}"
end
# rubocop:enable Metrics/BlockLength

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
groundskeeper-bitcore-0.12.0 config/git_config.rb
groundskeeper-bitcore-0.11.0 config/git_config.rb
groundskeeper-bitcore-0.10.0 config/git_config.rb
groundskeeper-bitcore-0.9.0 config/git_config.rb
groundskeeper-bitcore-0.8.0 config/git_config.rb
groundskeeper-bitcore-0.7.0 config/git_config.rb
groundskeeper-bitcore-0.6.0 config/git_config.rb
groundskeeper-bitcore-0.5.0 config/git_config.rb
groundskeeper-bitcore-0.4.0 config/git_config.rb
groundskeeper-bitcore-0.3.7 config/git_config.rb
groundskeeper-bitcore-0.3.6 config/git_config.rb
groundskeeper-bitcore-0.3.5 config/git_config.rb