summaryrefslogtreecommitdiff
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-03 14:20:15 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-03 14:20:15 +0000
commitc2c9236cde807e98ff9571f8d23ac4def75eb9ba (patch)
treed73a723a36681d83187e6c75a4b444315d943a9c /app/controllers/projects_controller.rb
parenta5b1a3a538bf59e49aea86d7ce2013c0a8d3ac2d (diff)
parent27a3fe8b98798861dc637b2642de24af3ea12d24 (diff)
downloadgitlab-ci-c2c9236cde807e98ff9571f8d23ac4def75eb9ba.tar.gz
Merge branch 'jobs_in_yml' into 'master'
CI configuration with .gitlab-ci.yml https://dev.gitlab.org/gitlab/gitlab-ci/issues/245 Example: ``` # Refs to skip skip_refs: “deploy*” # Run before each script before_script: - export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin - gem install bundler - cp config/database.yml.mysql config/database.yml - cp config/gitlab.yml.example config/gitlab.yml - touch log/application.log - touch log/test.log - bundle install --without postgres production --jobs $(nproc) - bundle exec rake db:create RAILS_ENV=test # Parallel jobs, each line is parallel build jobs: - script: “rake spec” runner: “ruby,postgres” name: “Rspec” - script: “rake spinach” runner: “ruby,mysql” name: “Spinach” tags: true branches: false # Parallel deploy jobs deploy_jobs: “cap deploy production” “cap deploy staging” ``` See merge request !110
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index a21dbc2..2ddd1aa 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -3,9 +3,9 @@ class ProjectsController < ApplicationController
before_filter :authenticate_user!, except: [:build, :badge, :index, :show]
before_filter :authenticate_public_page!, only: :show
- before_filter :project, only: [:build, :integration, :show, :badge, :edit, :update, :destroy, :toggle_shared_runners]
+ before_filter :project, only: [:build, :integration, :show, :badge, :edit, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
before_filter :authorize_access_project!, except: [:build, :gitlab, :badge, :index, :show, :new, :create]
- before_filter :authorize_manage_project!, only: [:edit, :integration, :update, :destroy, :toggle_shared_runners]
+ before_filter :authorize_manage_project!, only: [:edit, :integration, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
before_filter :authenticate_token!, only: [:build]
before_filter :no_cache, only: [:badge]
protect_from_forgery except: :build
@@ -109,6 +109,10 @@ class ProjectsController < ApplicationController
redirect_to :back
end
+ def dumped_yaml
+ send_data @project.generated_yaml_config, filename: '.gitlab-ci.yml'
+ end
+
protected
def project
@@ -123,8 +127,7 @@ class ProjectsController < ApplicationController
def project_params
params.require(:project).permit(:path, :timeout, :timeout_in_minutes, :default_ref, :always_build,
- :polling_interval, :public, :ssh_url_to_repo, :allow_git_fetch, :skip_refs, :email_recipients,
- :email_add_pusher, :email_only_broken_builds, :coverage_regex, :shared_runners_enabled, :token,
- { jobs_attributes: [:id, :name, :build_branches, :build_tags, :tag_list, :commands, :refs, :_destroy, :job_type] })
+ :polling_interval, :public, :ssh_url_to_repo, :allow_git_fetch, :email_recipients,
+ :email_add_pusher, :email_only_broken_builds, :coverage_regex, :shared_runners_enabled, :token)
end
end