Class: Jets::Code::User
- Inherits:
-
Object
- Object
- Jets::Code::User
- Defined in:
- lib/jets/code/user.rb
Instance Method Summary collapse
Instance Method Details
#iam_user ⇒ Object
18 19 20 21 22 |
# File 'lib/jets/code/user.rb', line 18 def iam_user @iam ||= Aws::IAM::Client.new @iam.get_user.user.user_name rescue Aws::IAM::Errors::ValidationError end |
#save ⇒ Object
7 8 9 10 11 12 |
# File 'lib/jets/code/user.rb', line 7 def save user = iam_user || ENV["USER"] || ENV["JETS_DEPLOY_USER"] FileUtils.mkdir_p(File.dirname(user_file)) IO.write(user_file, user) user end |
#user_file ⇒ Object
14 15 16 |
# File 'lib/jets/code/user.rb', line 14 def user_file "#{build_root}/stage/code/.jets/deploy_user" end |