Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit 7b8edb0

Browse files
committed
Merge branch 'remove_public_key_from_runner' into 'master'
Remove public key from runner
2 parents c010c8a + 436d0c2 commit 7b8edb0

18 files changed

+107
-78
lines changed

app/models/build.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# status :string(255)
99
# finished_at :datetime
1010
# trace :text
11-
# created_at :datetime not null
12-
# updated_at :datetime not null
11+
# created_at :datetime
12+
# updated_at :datetime
1313
# sha :string(255)
1414
# started_at :datetime
1515
# tmp_file :string(255)

app/models/project.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
#
33
# Table name: projects
44
#
5-
# id :integer not null, primary key
6-
# name :string(255) not null
7-
# timeout :integer default(1800), not null
8-
# scripts :text not null
9-
# created_at :datetime not null
10-
# updated_at :datetime not null
11-
# token :string(255)
12-
# default_ref :string(255)
13-
# gitlab_url :string(255)
14-
# always_build :boolean default(FALSE), not null
15-
# polling_interval :integer
16-
# public :boolean default(FALSE), not null
17-
# ssh_url_to_repo :string(255)
18-
# gitlab_id :integer
19-
# allow_git_fetch :boolean default(TRUE), not null
20-
# email_recipients :string(255) default(""), not null
21-
# email_add_committer :boolean default(TRUE), not null
5+
# id :integer not null, primary key
6+
# name :string(255) not null
7+
# timeout :integer default(1800), not null
8+
# scripts :text not null
9+
# created_at :datetime
10+
# updated_at :datetime
11+
# token :string(255)
12+
# default_ref :string(255)
13+
# gitlab_url :string(255)
14+
# always_build :boolean default(FALSE), not null
15+
# polling_interval :integer
16+
# public :boolean default(FALSE), not null
17+
# ssh_url_to_repo :string(255)
18+
# gitlab_id :integer
19+
# allow_git_fetch :boolean default(TRUE), not null
20+
# email_recipients :string(255) default(""), not null
21+
# email_add_committer :boolean default(TRUE), not null
2222
# email_only_broken_builds :boolean default(TRUE), not null
2323
#
2424

app/models/runner.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
#
55
# id :integer not null, primary key
66
# token :string(255)
7-
# public_key :text
8-
# created_at :datetime not null
9-
# updated_at :datetime not null
7+
# created_at :datetime
8+
# updated_at :datetime
109
# description :string(255)
1110
#
1211

@@ -17,7 +16,7 @@ class Runner < ActiveRecord::Base
1716

1817
has_one :last_build, ->() { order('id DESC') }, class_name: 'Build'
1918

20-
attr_accessible :token, :public_key, :description
19+
attr_accessible :token, :description
2120

2221
before_validation :set_default_values
2322

app/models/runner_project.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# id :integer not null, primary key
66
# runner_id :integer not null
77
# project_id :integer not null
8-
# created_at :datetime not null
9-
# updated_at :datetime not null
8+
# created_at :datetime
9+
# updated_at :datetime
1010
#
1111

1212
class RunnerProject < ActiveRecord::Base

app/models/web_hook.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# == Schema Information
2+
#
3+
# Table name: web_hooks
4+
#
5+
# id :integer not null, primary key
6+
# url :string(255) not null
7+
# project_id :integer not null
8+
# created_at :datetime
9+
# updated_at :datetime
10+
#
11+
112
class WebHook < ActiveRecord::Base
213
include HTTParty
314

config/application.yml.example.development

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ development:
55
host: localhost
66
port: 9000
77
https: false
8+
test:
9+
gitlab_server_urls:
10+
- 'http://demo.gitlab.com/'
11+
gitlab_ci:
12+
host: localhost
13+
port: 80
14+
https: false
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class RemovePublicKeyFromRunner < ActiveRecord::Migration
2+
def change
3+
remove_column :runners, :public_key
4+
end
5+
end

db/schema.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended that you check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(version: 20140222210357) do
14+
ActiveRecord::Schema.define(version: 20140506091853) do
1515

1616
# These are extensions that must be enabled in order to support this database
1717
enable_extension "plpgsql"
@@ -67,7 +67,6 @@
6767

6868
create_table "runners", force: true do |t|
6969
t.string "token"
70-
t.text "public_key"
7170
t.datetime "created_at"
7271
t.datetime "updated_at"
7372
t.string "description"

lib/api/runners.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ class Runners < Grape::API
2424
#
2525
# Parameters:
2626
# token (required) - The unique token of runner
27-
# public_key (required) - Deploy key used to get projects
2827
#
2928
# Example Request:
3029
# POST /runners/register
3130
post "register" do
3231
authenticate_runners!
33-
required_attributes! [:token, :public_key]
32+
required_attributes! [:token]
3433

35-
runner = Runner.create(public_key: params[:public_key])
34+
runner = Runner.create
3635

3736
if runner.id
3837
present runner, with: Entities::Runner

spec/factories/builds.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# status :string(255)
99
# finished_at :datetime
1010
# trace :text
11-
# created_at :datetime not null
12-
# updated_at :datetime not null
11+
# created_at :datetime
12+
# updated_at :datetime
1313
# sha :string(255)
1414
# started_at :datetime
1515
# tmp_file :string(255)

0 commit comments

Comments
 (0)