Skip to content
Snippets Groups Projects
Commit dec8e891 authored by Steven Pritchard's avatar Steven Pritchard
Browse files

(#350) Update deprecated globals

According to https://docs.gitlab.com/ee/ci/yaml/README.html#globally-defined-image-services-cache-before_script-after_script:

> Defining `image`, `services`, `cache`, `before_script`, and `after_script` globally is deprecated. Support could be removed from a future release.

This change moves `image`, `cache`, and `before_script` to the top-level `default` key instead.

Fixes #350.
parent 3e1d397e
No related branches found
No related tags found
No related merge requests found
...@@ -29,39 +29,42 @@ variables: ...@@ -29,39 +29,42 @@ variables:
<% end -%> <% end -%>
<% end -%> <% end -%>
<% if configs['image'] || configs['cache'] || !configs.has_key?('default_before_script') || configs['default_before_script'] -%>
default:
<% end -%>
<% if configs['image'] -%> <% if configs['image'] -%>
image: <%= configs['image'] %> image: <%= configs['image'] %>
<% end -%> <% end -%>
<% if configs['cache'] -%> <% if configs['cache'] -%>
cache: cache:
paths: paths:
<% configs['cache']['paths'].each do |path| -%> <% configs['cache']['paths'].each do |path| -%>
- <%= path %> - <%= path %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<% if !configs.has_key?('default_before_script') || configs['default_before_script'] -%> <% if !configs.has_key?('default_before_script') || configs['default_before_script'] -%>
before_script: before_script:
<% if configs['custom_before_steps'] -%> <% if configs['custom_before_steps'] -%>
<% configs['custom_before_steps'].each do |step| -%> <% configs['custom_before_steps'].each do |step| -%>
- <%= step %> - <%= step %>
<% end -%> <% end -%>
<% end -%> <% end -%>
- bundle -v - bundle -v
- rm Gemfile.lock || true - rm Gemfile.lock || true
<% if configs['rubygems_mirror'] -%> <% if configs['rubygems_mirror'] -%>
- gem sources -a <%= configs['rubygems_mirror'] %> --remove https://rubygems.org/ - gem sources -a <%= configs['rubygems_mirror'] %> --remove https://rubygems.org/
- bundle config mirror.http://rubygems.org/ <%= configs['rubygems_mirror'] %> - bundle config mirror.http://rubygems.org/ <%= configs['rubygems_mirror'] %>
- bundle config mirror.https://rubygems.org/ <%= configs['rubygems_mirror'] %> - bundle config mirror.https://rubygems.org/ <%= configs['rubygems_mirror'] %>
<% end -%> <% end -%>
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner" - "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
- "# Set `rubygems_version` in the .sync.yml to set a value" - "# Set `rubygems_version` in the .sync.yml to set a value"
- "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set" - "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
- '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION' - '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION'
- gem --version - gem --version
- bundle -v - bundle -v
- bundle install <%= configs['bundler_args'] %> - bundle install <%= configs['bundler_args'] %>
<% end -%> <% end -%>
<% if configs['ruby_versions'] -%> <% if configs['ruby_versions'] -%>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment