diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-19 13:31:42 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-19 13:31:42 +0200 |
commit | 967eb8fb550b8225177b8cb7f87afd81cfd0c213 (patch) | |
tree | d1d458a0e1d8c5448f2ae8db7415f770aa9bddaf /app/models/ci | |
parent | 748dd35c65b0a7f3fbb0832fd18933ff8c19ef7d (diff) | |
parent | c20e4267e89c1fa84b3eeb9f63e17677388c25e3 (diff) | |
download | gitlab-ce-967eb8fb550b8225177b8cb7f87afd81cfd0c213.tar.gz |
Merge branch 'master' into per-build-token
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/build.rb | 13 | ||||
-rw-r--r-- | app/models/ci/variable.rb | 6 |
2 files changed, 12 insertions, 7 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 8a9d7555393..dd984aef318 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -85,11 +85,14 @@ module Ci after_transition any => [:success] do |build| if build.environment.present? - service = CreateDeploymentService.new(build.project, build.user, - environment: build.environment, - sha: build.sha, - ref: build.ref, - tag: build.tag) + service = CreateDeploymentService.new( + build.project, build.user, + environment: build.environment, + sha: build.sha, + ref: build.ref, + tag: build.tag, + options: build.options[:environment], + variables: build.variables) service.execute(build) end end diff --git a/app/models/ci/variable.rb b/app/models/ci/variable.rb index c9c47ec7419..6959223aed9 100644 --- a/app/models/ci/variable.rb +++ b/app/models/ci/variable.rb @@ -1,7 +1,7 @@ module Ci class Variable < ActiveRecord::Base extend Ci::Model - + belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id validates_uniqueness_of :key, scope: :gl_project_id @@ -11,7 +11,9 @@ module Ci format: { with: /\A[a-zA-Z0-9_]+\z/, message: "can contain only letters, digits and '_'." } - attr_encrypted :value, + scope :order_key_asc, -> { reorder(key: :asc) } + + attr_encrypted :value, mode: :per_attribute_iv_and_salt, insecure_mode: true, key: Gitlab::Application.secrets.db_key_base, |