diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-05 13:18:35 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-05 13:18:35 +0000 |
commit | e32c82ed1eabc0e409e91d5d210f1ecc6fd4c091 (patch) | |
tree | f77994e07005092aaaa3f7d48d442ccbe98a07df /lib | |
parent | 4dd53240fb760af16e43f4ee6a3ff12dc296d7e0 (diff) | |
download | gitlab-ce-e32c82ed1eabc0e409e91d5d210f1ecc6fd4c091.tar.gz |
Revert "Merge branch 'require-all-templates-to-include-default-stages' into 'master'"
This reverts merge request !26954
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/config.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/config/external/file/local.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Android.gitlab-ci.yml | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Chef.gitlab-ci.yml | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Go.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Mono.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/OpenShift.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Packer.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Serverless.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Swift.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Terraform.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/iOS-Fastlane.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/template/base_template.rb | 6 |
15 files changed, 13 insertions, 29 deletions
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index f187e456993..15643fa03ac 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -73,13 +73,17 @@ module Gitlab def build_config(config, project:, sha:, user:) initial_config = Gitlab::Config::Loader::Yaml.new(config).load! - process_external_files(initial_config, project: project, sha: sha, user: user) + if project + process_external_files(initial_config, project: project, sha: sha, user: user) + else + initial_config + end end def process_external_files(config, project:, sha:, user:) Config::External::Processor.new(config, project: project, - sha: sha || project&.repository&.root_ref_sha, + sha: sha || project.repository.root_ref_sha, user: user, expandset: Set.new).perform end diff --git a/lib/gitlab/ci/config/external/file/local.rb b/lib/gitlab/ci/config/external/file/local.rb index cac321ec4a6..229a06451e8 100644 --- a/lib/gitlab/ci/config/external/file/local.rb +++ b/lib/gitlab/ci/config/external/file/local.rb @@ -21,9 +21,7 @@ module Gitlab private def validate_content! - if context.project&.repository.nil? - errors.push("Local file `#{location}` does not have project!") - elsif content.nil? + if content.nil? errors.push("Local file `#{location}` does not exist!") elsif content.blank? errors.push("Local file `#{location}` is empty!") diff --git a/lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml b/lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml index 120272200c6..8e767b22360 100644 --- a/lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml @@ -6,7 +6,6 @@ stages: - environment - build - test - - deploy - internal - alpha - beta diff --git a/lib/gitlab/ci/templates/Android.gitlab-ci.yml b/lib/gitlab/ci/templates/Android.gitlab-ci.yml index 2be7f933462..c169e3f7686 100644 --- a/lib/gitlab/ci/templates/Android.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Android.gitlab-ci.yml @@ -24,6 +24,10 @@ before_script: - yes | android-sdk-linux/tools/bin/sdkmanager --licenses - set -o pipefail +stages: + - build + - test + lintDebug: stage: build script: diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml index 611b25c2113..f786022beb0 100644 --- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml @@ -60,7 +60,6 @@ variables: stages: - build - test - - deploy # dummy stage to follow the template guidelines - review - dast - staging diff --git a/lib/gitlab/ci/templates/Chef.gitlab-ci.yml b/lib/gitlab/ci/templates/Chef.gitlab-ci.yml index 1e14aa8bea9..33507aa58e4 100644 --- a/lib/gitlab/ci/templates/Chef.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Chef.gitlab-ci.yml @@ -14,11 +14,9 @@ variables: KITCHEN_LOCAL_YAML: ".kitchen.dokken.yml" stages: - - build - lint - - test + - unit - functional - - deploy foodcritic: stage: lint @@ -31,7 +29,7 @@ cookstyle: - chef exec cookstyle . chefspec: - stage: test + stage: unit script: - chef exec rspec spec diff --git a/lib/gitlab/ci/templates/Go.gitlab-ci.yml b/lib/gitlab/ci/templates/Go.gitlab-ci.yml index 55fda1a4799..d572d7a1edc 100644 --- a/lib/gitlab/ci/templates/Go.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Go.gitlab-ci.yml @@ -18,7 +18,6 @@ before_script: stages: - test - build - - deploy format: stage: test diff --git a/lib/gitlab/ci/templates/Mono.gitlab-ci.yml b/lib/gitlab/ci/templates/Mono.gitlab-ci.yml index 10fb6be6c39..86d62b93313 100644 --- a/lib/gitlab/ci/templates/Mono.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Mono.gitlab-ci.yml @@ -15,7 +15,6 @@ image: mono:latest stages: - - build - test - deploy diff --git a/lib/gitlab/ci/templates/OpenShift.gitlab-ci.yml b/lib/gitlab/ci/templates/OpenShift.gitlab-ci.yml index 61a925e0d2d..290b9997084 100644 --- a/lib/gitlab/ci/templates/OpenShift.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/OpenShift.gitlab-ci.yml @@ -1,9 +1,7 @@ image: ayufan/openshift-cli stages: - - build # dummy stage to follow the template guidelines - test - - deploy # dummy stage to follow the template guidelines - review - staging - production diff --git a/lib/gitlab/ci/templates/Packer.gitlab-ci.yml b/lib/gitlab/ci/templates/Packer.gitlab-ci.yml index 83e179f37c3..fa296057c72 100644 --- a/lib/gitlab/ci/templates/Packer.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Packer.gitlab-ci.yml @@ -9,8 +9,6 @@ before_script: stages: - validate - - build - - test - deploy validate: diff --git a/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml b/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml index 4e0d3de9389..4f3d08d98fe 100644 --- a/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml @@ -4,7 +4,6 @@ image: alpine:latest stages: - build - - test - deploy .serverless:build:image: diff --git a/lib/gitlab/ci/templates/Swift.gitlab-ci.yml b/lib/gitlab/ci/templates/Swift.gitlab-ci.yml index 9aa4abd4791..ba8a802ba4f 100644 --- a/lib/gitlab/ci/templates/Swift.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Swift.gitlab-ci.yml @@ -2,9 +2,7 @@ # This file assumes an own GitLab CI runner, setup on a macOS system. stages: - build - - test - archive - - deploy build_project: stage: build diff --git a/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml b/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml index f374bc7e26a..7160fce26a8 100644 --- a/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml @@ -24,7 +24,6 @@ before_script: stages: - validate - build - - test - deploy validate: diff --git a/lib/gitlab/ci/templates/iOS-Fastlane.gitlab-ci.yml b/lib/gitlab/ci/templates/iOS-Fastlane.gitlab-ci.yml index a4a9e96c1d2..df6ac4d340d 100644 --- a/lib/gitlab/ci/templates/iOS-Fastlane.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/iOS-Fastlane.gitlab-ci.yml @@ -12,8 +12,6 @@ stages: - build - - test - - deploy variables: LC_ALL: "en_US.UTF-8" diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb index 14c9a3e0389..0b4cc571dc0 100644 --- a/lib/gitlab/template/base_template.rb +++ b/lib/gitlab/template/base_template.rb @@ -16,12 +16,6 @@ module Gitlab end alias_method :key, :name - def full_name - Pathname.new(@path) - .relative_path_from(self.class.base_dir) - .to_s - end - def content @finder.read(@path) end |