Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-23 14:20:32 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-23 14:20:32 +0400
commite6afbff4c23b2b9c178d8e67436c458079b0bc9a (patch)
tree2e88de7ba879647af9198a88350c12e07c47bab5 /app
parentbaa74b07345d48144b36524332ea3f28d9602879 (diff)
parent4db87f7c4bd46983c1aad8ed7cc7338ca7bbf72e (diff)
Merge pull request #5640 from carlosparamio/assembla_service
Integration with Assembla
Diffstat (limited to 'app')
-rw-r--r--app/models/assembla_service.rb45
-rw-r--r--app/models/project.rb3
2 files changed, 47 insertions, 1 deletions
diff --git a/app/models/assembla_service.rb b/app/models/assembla_service.rb
new file mode 100644
index 00000000000..66ecf394784
--- /dev/null
+++ b/app/models/assembla_service.rb
@@ -0,0 +1,45 @@
+# == Schema Information
+#
+# Table name: services
+#
+# id :integer not null, primary key
+# type :string(255)
+# title :string(255)
+# token :string(255)
+# project_id :integer not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# active :boolean default(FALSE), not null
+# project_url :string(255)
+# subdomain :string(255)
+# room :string(255)
+#
+
+class AssemblaService < Service
+ include HTTParty
+
+ validates :token, presence: true, if: :activated?
+
+ def title
+ 'Assembla'
+ end
+
+ def description
+ 'Project Management Software (Source Commits Endpoint)'
+ end
+
+ def to_param
+ 'assembla'
+ end
+
+ def fields
+ [
+ { type: 'text', name: 'token', placeholder: '' }
+ ]
+ end
+
+ def execute(push)
+ url = "https://atlas.assembla.com/spaces/ouposp/github_tool?secret_key=#{token}"
+ AssemblaService.post(url, body: { payload: push }.to_json, headers: { 'Content-Type' => 'application/json' })
+ end
+end
diff --git a/app/models/project.rb b/app/models/project.rb
index e255f13c42d..eab7c14d6c6 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -50,6 +50,7 @@ class Project < ActiveRecord::Base
has_one :pivotaltracker_service, dependent: :destroy
has_one :hipchat_service, dependent: :destroy
has_one :flowdock_service, dependent: :destroy
+ has_one :assembla_service, dependent: :destroy
has_one :forked_project_link, dependent: :destroy, foreign_key: "forked_to_project_id"
has_one :forked_from_project, through: :forked_project_link
@@ -224,7 +225,7 @@ class Project < ActiveRecord::Base
end
def available_services_names
- %w(gitlab_ci campfire hipchat pivotaltracker flowdock)
+ %w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla)
end
def gitlab_ci?