diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-10-05 23:38:02 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-10-05 23:38:02 +0900 |
commit | 7542a5d102bc48f5f7b8104fda22f0975b2dd931 (patch) | |
tree | 9a94528103422fa5baaab096091e34ae6463d507 /lib/gitlab/ci | |
parent | 8deb9c010fb4ab24b56a68470ecbf4b875467248 (diff) | |
parent | 88fa9a3c31d250ae9b88bb3250204b39eabc14b4 (diff) | |
download | gitlab-ce-7542a5d102bc48f5f7b8104fda22f0975b2dd931.tar.gz |
Merge branch 'master-ce' into scheduled-manual-jobs
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/build/policy/changes.rb | 25 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/policy.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml | 7 |
3 files changed, 31 insertions, 7 deletions
diff --git a/lib/gitlab/ci/build/policy/changes.rb b/lib/gitlab/ci/build/policy/changes.rb new file mode 100644 index 00000000000..7bf51519752 --- /dev/null +++ b/lib/gitlab/ci/build/policy/changes.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module Build + module Policy + class Changes < Policy::Specification + def initialize(globs) + @globs = Array(globs) + end + + def satisfied_by?(pipeline, seed) + return true unless pipeline.branch_updated? + + pipeline.modified_paths.any? do |path| + @globs.any? do |glob| + File.fnmatch?(glob, path, File::FNM_PATHNAME | File::FNM_DOTMATCH) + end + end + end + end + end + end + end +end diff --git a/lib/gitlab/ci/config/entry/policy.rb b/lib/gitlab/ci/config/entry/policy.rb index 09e8e52b60f..c92562f8c85 100644 --- a/lib/gitlab/ci/config/entry/policy.rb +++ b/lib/gitlab/ci/config/entry/policy.rb @@ -25,17 +25,19 @@ module Gitlab include Entry::Validatable include Entry::Attributable - attributes :refs, :kubernetes, :variables + ALLOWED_KEYS = %i[refs kubernetes variables changes].freeze + attributes :refs, :kubernetes, :variables, :changes validations do validates :config, presence: true - validates :config, allowed_keys: %i[refs kubernetes variables] + validates :config, allowed_keys: ALLOWED_KEYS validate :variables_expressions_syntax with_options allow_nil: true do validates :refs, array_of_strings_or_regexps: true validates :kubernetes, allowed_values: %w[active] validates :variables, array_of_strings: true + validates :changes, array_of_strings: true end def variables_expressions_syntax diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml index a96595b33a5..ed4ec7e6385 100644 --- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml @@ -689,9 +689,6 @@ rollout 100%: helm version --client tiller -version - helm init --client-only - helm plugin install https://github.com/adamreese/helm-local - curl -L -o /usr/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl" chmod +x /usr/bin/kubectl kubectl version --client @@ -800,9 +797,9 @@ rollout 100%: function initialize_tiller() { echo "Checking Tiller..." - helm local start - helm local status export HELM_HOST=":44134" + tiller -listen ${HELM_HOST} -alsologtostderr > /dev/null 2>&1 & + echo "Tiller is listening on ${HELM_HOST}" if ! helm version --debug; then echo "Failed to init Tiller." |