diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-01-04 21:24:58 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-01-05 19:59:10 +0100 |
commit | 6ef6f9f205b8bed4ff0af4a353e7b04e0ff0b345 (patch) | |
tree | d557c2da9f2afc17e3ecc96f6c7c5225e2623701 /spec/lib/ci | |
parent | cd85baf5e363847ee1cca2e154e5fb47484e0fdf (diff) | |
download | gitlab-ce-6ef6f9f205b8bed4ff0af4a353e7b04e0ff0b345.tar.gz |
Do not check for valid url for .gitlab-ci.yml
Until this commit, GitLab would check if the URL in your .gitlab-ci.yml
would be valid and adressable. However, this approach is rather limited.
To begin, the URL couldn't be http://example:$PORT/my-project, as the
PORT value would be interpolated after checking if the URL was valid,
which its not. Also this gem will limit the amount of protocols allowed.
This commit doesn't check, at all, if the URL is valid. This is now the
responsablilty of the user. In my opion this is right, as the user
ultimately benefits from a correct URL, but also, its impossible to
cover all cases.
Diffstat (limited to 'spec/lib/ci')
-rw-r--r-- | spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 62d68721574..f824e2e1efe 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -769,6 +769,19 @@ module Ci expect(builds.first[:environment]).to eq(environment[:name]) expect(builds.first[:options]).to include(environment: environment) end + + context 'the url has a port as variable' do + let(:environment) do + { name: 'production', + url: 'http://production.gitlab.com:$PORT' } + end + + it 'allows a variable for the port' do + expect(builds.size).to eq(1) + expect(builds.first[:environment]).to eq(environment[:name]) + expect(builds.first[:options]).to include(environment: environment) + end + end end context 'when no environment is specified' do |