Class: Releasy::Deployers::Github

Inherits:
Deployer
  • Object
show all
Defined in:
lib/releasy/deployers/github.rb

Overview

Deploys to a Github project’s downloads page.

Examples:

Releasy::Project.new do
  name "My App"
  add_build :source
  add_package :zip
  add_deploy :github # Should be enough if git is configured correctly.
end

Constant Summary collapse

TYPE =
:github
UPLOAD_TIMEOUT =

Maximum time to allow an upload to continue. An hour to upload a file isn’t unreasonable. Better than the default 2 minutes, which uploads about 4MB for me.

60 * 60

Constants inherited from Deployer

Deployer::WORKING_CHARACTER

Constants included from Mixins::Log

Mixins::Log::DEFAULT_LOG_LEVEL, Mixins::Log::LOG_LEVELS

Instance Attribute Summary collapse

Attributes inherited from Deployer

#project

Instance Method Summary collapse

Methods inherited from Deployer

#initialize, #type

Methods included from Mixins::Log

log_level, log_level=

Constructor Details

This class inherits a constructor from Releasy::Deployers::Deployer

Instance Attribute Details

#descriptionString

(project.description) Description of file.

Returns:

  • (String)

    the current value of description



19
20
21
# File 'lib/releasy/deployers/github.rb', line 19

def description
  @description
end

#repositoryString

(repository name in ‘git config remote.origin.url` or project.underscored_name) Name of Github repository.

Returns:

  • (String)

    the current value of repository



19
20
21
# File 'lib/releasy/deployers/github.rb', line 19

def repository
  @repository
end

#tokenString

(‘git config github.token`) Github token associated with #user - a 32-digit hexadecimal string - DO NOT COMMIT A FILE CONTAINING YOUR GITHUB TOKEN!

Returns:

  • (String)

    the current value of token



19
20
21
# File 'lib/releasy/deployers/github.rb', line 19

def token
  @token
end

#userString

(‘git config github.user` or user name in `git config remote.origin.url`) Github user name that has write access to #repository

Returns:

  • (String)

    the current value of user



19
20
21
# File 'lib/releasy/deployers/github.rb', line 19

def user
  @user
end

Instance Method Details

#replace!Object

Force replacement of existing uploaded files.



52
53
54
# File 'lib/releasy/deployers/github.rb', line 52

def replace!
  @force_replace = true
end