class DPL::Provider::Transifex

Constants

DEFAULT_CLIENT_VERSION
DEFAULT_HOSTNAME

Public Instance Methods

check_auth() click to toggle source
# File lib/dpl/provider/transifex.rb, line 18
def check_auth
  install_deploy_dependencies
  write_transifexrc
  context.shell 'tx status'
end
install_deploy_dependencies() click to toggle source
# File lib/dpl/provider/transifex.rb, line 9
def install_deploy_dependencies
  cli_version = options[:cli_version] || DEFAULT_CLIENT_VERSION
  self.class.pip 'transifex', 'transifex', cli_version
end
needs_key?() click to toggle source
# File lib/dpl/provider/transifex.rb, line 14
def needs_key?
  false
end
push_app() click to toggle source
# File lib/dpl/provider/transifex.rb, line 24
def push_app
  source_push
end
source_push() click to toggle source
# File lib/dpl/provider/transifex.rb, line 40
def source_push
  context.shell 'tx push --source --no-interactive', retry: true
end
write_transifexrc() click to toggle source
# File lib/dpl/provider/transifex.rb, line 28
def write_transifexrc
  File.open(File.expand_path('~/.transifexrc'), 'w') do |f|
    f.puts [
      "[#{options[:hostname] || DEFAULT_HOSTNAME}]",
      "hostname = #{options[:hostname] || DEFAULT_HOSTNAME}",
      "username = #{options[:username]}",
      "password = #{options[:password]}",
      "token = #{options[:token]}",
    ].join("\n")
  end
end