Sha256: 4689e9ce63c916ca86ea4499787f553378e940054d715ea3ee04a919ce72bac7

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 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 :repo_name, project.repo_name
  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, tag
end
# rubocop:enable Metrics/BlockLength

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
groundskeeper-bitcore-0.14.0 config/git_config.rb
groundskeeper-bitcore-0.13.0 config/git_config.rb