Skip to content

Instantly share code, notes, and snippets.

@gin0606
Last active August 29, 2015 14:01
Show Gist options
  • Save gin0606/a56c1991e9b12e46c192 to your computer and use it in GitHub Desktop.
Save gin0606/a56c1991e9b12e46c192 to your computer and use it in GitHub Desktop.
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
# 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