Class: WaxTasks::TravisBranch
- Defined in:
- lib/wax_tasks/travis_branch.rb
Overview
Branch object for ‘$ wax:push` task when run on Travis-CI VM using encrypted Travis environment vars
Instance Attribute Summary collapse
-
#baseurl ⇒ String
the site baseurl to build with (if on gh-pages).
-
#commit_msg ⇒ String
the commit message to use on push.
-
#origin ⇒ String
the current repository remote.
-
#repo_slug ⇒ String
the ‘user/repo_name’.
-
#success_msg ⇒ String
informative message to be output to console.
-
#token ⇒ String
secret git access token.
-
#user ⇒ String
the GitHub user making the commit/push.
Attributes inherited from Branch
Instance Method Summary collapse
-
#initialize(site, target) ⇒ TravisBranch
constructor
A new instance of TravisBranch.
Methods inherited from Branch
Constructor Details
#initialize(site, target) ⇒ TravisBranch
Returns a new instance of TravisBranch.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wax_tasks/travis_branch.rb', line 15 def initialize(site, target) super(site, target) @repo_slug = ENV['TRAVIS_REPO_SLUG'] @user = @repo_slug.split('/').first @token = ENV['ACCESS_TOKEN'] @commit_msg = "Updated via #{ENV['TRAVIS_COMMIT']} @#{Time.now.utc}" @origin = "https://#{@user}:#{@token}@github.com/#{@repo_slug}.git" @baseurl = "/#{@repo_slug.split('/').last}" @success_msg = "Deploying to #{@target} branch from Travis as #{@user}." end |
Instance Attribute Details
#baseurl ⇒ String
the site baseurl to build with (if on gh-pages)
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def baseurl @baseurl end |
#commit_msg ⇒ String
the commit message to use on push
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def commit_msg @commit_msg end |
#origin ⇒ String
the current repository remote
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def origin @origin end |
#repo_slug ⇒ String
the ‘user/repo_name’
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def repo_slug @repo_slug end |
#success_msg ⇒ String
informative message to be output to console
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def success_msg @success_msg end |
#token ⇒ String
secret git access token
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def token @token end |
#user ⇒ String
the GitHub user making the commit/push
14 15 16 |
# File 'lib/wax_tasks/travis_branch.rb', line 14 def user @user end |