Sha256: 7cb739ae6acea292d194ff4f150485fe0245d0ef9f50750f41c3b062cb32ad03

Contents?: true

Size: 1.5 KB

Versions: 8

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

require "yaml"
require "json"
require "groundskeeper/project"
require "groundskeeper/document"
require "groundskeeper/git"
require "groundskeeper/executable"

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 :smtp_domain, project.smtp_domain

  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.fetch("tag", nil)
  unless tags.include? tag
    raise "Tag \"#{tag}\" not found. Available tags:\n #{tags.join("\n")}"
  end

  set :branch, "master"
  set :tag, tag
  set :nginx, fetch(:nginx)
end
# rubocop:enable Metrics/BlockLength

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
groundskeeper-bitcore-0.34.0 config/git_config.rb
groundskeeper-bitcore-0.33.0 config/git_config.rb
groundskeeper-bitcore-0.32.0 config/git_config.rb
groundskeeper-bitcore-0.31.0 config/git_config.rb
groundskeeper-bitcore-0.29.0 config/git_config.rb
groundskeeper-bitcore-0.28.0 config/git_config.rb
groundskeeper-bitcore-0.27.0 config/git_config.rb
groundskeeper-bitcore-0.26.0 config/git_config.rb