Class: DPL::Provider::Transifex
- Inherits:
-
DPL::Provider
- Object
- DPL::Provider
- DPL::Provider::Transifex
- Defined in:
- lib/dpl/provider/transifex.rb
Constant Summary collapse
- DEFAULT_CLIENT_VERSION =
'>=0.11'
- DEFAULT_HOSTNAME =
'https://www.transifex.com'
Instance Method Summary collapse
- #check_auth ⇒ Object
- #install_deploy_dependencies ⇒ Object
- #needs_key? ⇒ Boolean
- #push_app ⇒ Object
- #source_push ⇒ Object
- #write_transifexrc ⇒ Object
Instance Method Details
#check_auth ⇒ Object
18 19 20 21 22 |
# File 'lib/dpl/provider/transifex.rb', line 18 def check_auth install_deploy_dependencies write_transifexrc context.shell 'tx status' end |
#install_deploy_dependencies ⇒ Object
9 10 11 12 |
# File 'lib/dpl/provider/transifex.rb', line 9 def install_deploy_dependencies cli_version = [:cli_version] || DEFAULT_CLIENT_VERSION self.class.pip 'transifex', 'transifex', cli_version end |
#needs_key? ⇒ Boolean
14 15 16 |
# File 'lib/dpl/provider/transifex.rb', line 14 def needs_key? false end |
#push_app ⇒ Object
24 25 26 |
# File 'lib/dpl/provider/transifex.rb', line 24 def push_app source_push end |
#source_push ⇒ Object
40 41 42 |
# File 'lib/dpl/provider/transifex.rb', line 40 def source_push context.shell 'tx push --source --no-interactive', retry: true end |
#write_transifexrc ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dpl/provider/transifex.rb', line 28 def write_transifexrc File.open(File.('~/.transifexrc'), 'w') do |f| f.puts [ "[#{[:hostname] || DEFAULT_HOSTNAME}]", "hostname = #{[:hostname] || DEFAULT_HOSTNAME}", "username = #{[:username]}", "password = #{[:password]}", "token = #{[:token]}", ].join("\n") end end |