Last active
August 29, 2015 14:01
-
-
Save gin0606/a56c1991e9b12e46c192 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DeployGate | |
def self.invite user_name, api_fragment, app_id, token | |
invite_api_url = "https://deploygate.com/api/users/#{account_name}/#{api_fragment}/#{app_id}/members" | |
%x(curl '#{invite_api_url}' -F 'users=[#{user_name}]' -F 'token=#{token}' -F role=2) | |
end | |
def self.upload file_path, token | |
%x(curl 'https://deploygate.com/api/users/#{account_name}/apps' -F 'file=@#{file_path}' -F 'token=#{token}') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inviteはPlatform毎にAPIのURL違うから↓こんな感じにする | |
DeployGate.invite args.user_name, 'platforms/ios/apps', 'org.example.ios_app', ENV['DEPLOYGATE_TOKEN'] | |
DeployGate.invite args.user_name, 'apps', 'org.example.android_app', ENV['DEPLOYGATE_TOKEN'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment