Sha256: 5d5c0de9543bed99223425d6e86c392474f1c4692f6a8171f9bc0313de7db9ed

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

require 'capistrano/i18n'
require 'dkdeploy/i18n'
require 'dkdeploy/constants'

include Capistrano::DSL

namespace :project_version do
  desc 'Update Version file on server'
  task :update, :version_file_path do |_, args|
    version_file_path = ask_variable(args, :version_file_path, 'questions.version_file_path')
    remote_version_file = File.join release_path, version_file_path, 'Version'
    local_version_file = 'Version'

    unless File.exist? local_version_file # check if the local version file exists
      run_locally do
        error I18n.t('file.not_exists', file: local_version_file, scope: :dkdeploy)
        exit 1
      end
    end

    on release_roles :app do
      info I18n.t('tasks.project_version.update.update', scope: :dkdeploy)
      # remove the to be replaced remote version file
      if test " [ -f #{remote_version_file} ] "
        execute :rm, '-f', remote_version_file
      end
      # upload the current version file
      upload! local_version_file, remote_version_file
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dkdeploy-core-9.1.1 lib/dkdeploy/tasks/project_version.rake
dkdeploy-core-9.0.1 lib/dkdeploy/tasks/project_version.rake
dkdeploy-core-9.1.0 lib/dkdeploy/tasks/project_version.rake
dkdeploy-core-9.0.0 lib/dkdeploy/tasks/project_version.rake