diff options
-rw-r--r-- | app/models/project.rb | 8 | ||||
-rw-r--r-- | db/migrate/20141127153745_remove_scripts_from_project.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 7 | ||||
-rw-r--r-- | doc/api/projects.md | 5 | ||||
-rw-r--r-- | doc/install/installation.md | 2 | ||||
-rw-r--r-- | lib/api/entities.rb | 2 | ||||
-rw-r--r-- | lib/api/projects.rb | 5 | ||||
-rw-r--r-- | spec/factories/projects.rb | 2 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 3 |
9 files changed, 15 insertions, 24 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 9bf3302..50dfc80 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -5,7 +5,6 @@ # id :integer not null, primary key # name :string(255) not null # timeout :integer default(1800), not null -# scripts :text not null # created_at :datetime # updated_at :datetime # token :string(255) @@ -27,7 +26,7 @@ class Project < ActiveRecord::Base include ProjectStatus - attr_accessible :name, :path, :scripts, :timeout, :token, :timeout_in_minutes, + attr_accessible :name, :path, :timeout, :token, :timeout_in_minutes, :default_ref, :gitlab_url, :always_build, :polling_interval, :public, :ssh_url_to_repo, :gitlab_id, :allow_git_fetch, :skip_refs, :email_recipients, :email_add_committer, :email_only_broken_builds, :coverage_regex, @@ -45,7 +44,7 @@ class Project < ActiveRecord::Base # # Validations # - validates_presence_of :name, :scripts, :timeout, :token, :default_ref, + validates_presence_of :name, :timeout, :token, :default_ref, :gitlab_url, :ssh_url_to_repo, :gitlab_id validates_uniqueness_of :name @@ -74,8 +73,7 @@ ls -la params = { name: project.name_with_namespace, gitlab_id: project.id, - gitlab_url: project.web_url, - scripts: Project.base_build_script, + gitlab_url: project.web_url, default_ref: project.default_branch || 'master', ssh_url_to_repo: project.ssh_url_to_repo, email_add_committer: GitlabCi.config.gitlab_ci.add_committer, diff --git a/db/migrate/20141127153745_remove_scripts_from_project.rb b/db/migrate/20141127153745_remove_scripts_from_project.rb new file mode 100644 index 0000000..d287093 --- /dev/null +++ b/db/migrate/20141127153745_remove_scripts_from_project.rb @@ -0,0 +1,5 @@ +class RemoveScriptsFromProject < ActiveRecord::Migration + def change + remove_column :projects, :scripts + end +end
\ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 5dbf408..8e8edcc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -18,17 +18,17 @@ ActiveRecord::Schema.define(version: 20141201153755) do t.string "ref" t.string "status" t.datetime "finished_at" - t.text "trace" + t.text "trace", limit: 2147483647 t.datetime "created_at" t.datetime "updated_at" t.string "sha" t.datetime "started_at" t.string "tmp_file" t.string "before_sha" - t.text "push_data" + t.text "push_data", limit: 16777215 t.integer "runner_id" - t.float "coverage" t.integer "commit_id" + t.float "coverage" t.text "commands" t.integer "job_id" end @@ -68,7 +68,6 @@ ActiveRecord::Schema.define(version: 20141201153755) do create_table "projects", force: true do |t| t.string "name", null: false t.integer "timeout", default: 1800, null: false - t.text "scripts", null: false t.datetime "created_at" t.datetime "updated_at" t.string "token" diff --git a/doc/api/projects.md b/doc/api/projects.md index 5086127..1a74b5c 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -23,7 +23,6 @@ Returns: "id" : 271, "name" : "gitlabhq", "timeout" : 1800, - "scripts" : "ls", "token" : "iPWx6WM4lhHNedGfBpPJNP", "default_ref" : "master", "gitlab_url" : "http://demo.gitlabhq.com/gitlab/gitlab-shell", @@ -37,7 +36,6 @@ Returns: "id" : 272, "name" : "gitlab-ci", "timeout" : 1800, - "scripts" : "ls", "token" : "iPWx6WM4lhHNedGfBpPJNP", "default_ref" : "master", "gitlab_url" : "http://demo.gitlabhq.com/gitlab/gitlab-shell", @@ -66,7 +64,6 @@ Returns: "id" : 272, "name" : "gitlab-ci", "timeout" : 1800, - "scripts" : "ls", "token" : "iPWx6WM4lhHNedGfBpPJNP", "default_ref" : "master", "gitlab_url" : "http://demo.gitlabhq.com/gitlab/gitlab-shell", @@ -102,7 +99,6 @@ Parameters: * `gitlab_id` (required) - The ID of the project on the Gitlab instance * `gitlab_url` (required) - The web url of the project on the Gitlab instance * `ssh_url_to_repo` (required) - The gitlab SSH url to the repo - * `scripts` (optional) - The shell script provided for a runner to run (defaults to `ls -al`) * `default_ref` (optional) - The branch to run on (default to `master`) ### Update Project @@ -118,7 +114,6 @@ Parameters: * `gitlab_id` - The ID of the project on the Gitlab instance * `gitlab_url` - The web url of the project on the Gitlab instance * `ssh_url_to_repo` - The gitlab SSH url to the repo - * `scripts` - The shell script provided for a runner to run (defaults to `ls -al`) * `default_ref` - The branch to run on (default to `master`) ### Remove Project diff --git a/doc/install/installation.md b/doc/install/installation.md index 97814ba..b12efbe 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -30,7 +30,7 @@ the default editor. Install the required packages: - sudo apt-get install wget curl gcc checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev openssh-server git-core libyaml-dev postfix libpq-dev libicu-dev + sudo apt-get install wget curl gcc checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev openssh-server git-core libyaml-dev postfix libpq-dev libicu-dev openssl sudo apt-get install redis-server # 2. Ruby diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 9f4ea7f..0748442 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -17,7 +17,7 @@ module API end class Project < Grape::Entity - expose :id, :name, :timeout, :scripts, :token, :default_ref, :gitlab_url, :always_build, :polling_interval, :public, :ssh_url_to_repo, :gitlab_id + expose :id, :name, :timeout, :token, :default_ref, :gitlab_url, :always_build, :polling_interval, :public, :ssh_url_to_repo, :gitlab_id end class RunnerProject < Grape::Entity diff --git a/lib/api/projects.rb b/lib/api/projects.rb index d6cd689..89faa04 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -55,7 +55,6 @@ module API # gitlab_id (required) - The gitlab id of the project # gitlab_url (required) - The gitlab web url to the project # ssh_url_to_repo (required) - The gitlab ssh url to the repo - # scripts - The shell script provided for a runner to run # default_ref - The branch to run against (defaults to `master`) # Example Request: # POST /projects @@ -66,7 +65,6 @@ module API :name => params[:name], :gitlab_id => params[:gitlab_id], :gitlab_url => params[:gitlab_url], - :scripts => params[:scripts] || 'ls -al', :default_ref => params[:default_ref] || 'master', :ssh_url_to_repo => params[:ssh_url_to_repo] } @@ -90,7 +88,6 @@ module API # gitlab_id - The gitlab id of the project # gitlab_url - The gitlab web url to the project # ssh_url_to_repo - The gitlab ssh url to the repo - # scripts - The shell script provided for a runner to run # default_ref - The branch to run against (defaults to `master`) # Example Request: # PUT /projects/:id @@ -98,7 +95,7 @@ module API project = Project.find(params[:id]) if project.present? && current_user.can_access_project?(project.gitlab_id) - attrs = attributes_for_keys [:name, :gitlab_id, :gitlab_url, :scripts, :default_ref, :ssh_url_to_repo] + attrs = attributes_for_keys [:name, :gitlab_id, :gitlab_url, :default_ref, :ssh_url_to_repo] if project.update_attributes(attrs) present project, :with => Entities::Project diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 46b11d5..552cd4e 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -5,7 +5,6 @@ # id :integer not null, primary key # name :string(255) not null # timeout :integer default(1800), not null -# scripts :text not null # created_at :datetime # updated_at :datetime # token :string(255) @@ -33,7 +32,6 @@ FactoryGirl.define do gitlab_url 'http://demo.gitlabhq.com/gitlab/gitlab-shell' ssh_url_to_repo 'git@demo.gitlab.com:gitlab/gitlab-shell.git' gitlab_id 8 - scripts 'ls' factory :project do token 'iPWx6WM4lhHNedGfBpPJNP' diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 9e44542..7ae8289 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -31,8 +31,7 @@ describe Project do it { should have_many(:commits) } - it { should validate_presence_of :name } - it { should validate_presence_of :scripts } + it { should validate_presence_of :name } it { should validate_presence_of :timeout } it { should validate_presence_of :default_ref } |