Skip to content
Snippets Groups Projects
Unverified Commit dd6e2370 authored by sanfrancrisko's avatar sanfrancrisko Committed by GitHub
Browse files

Merge pull request #436 from skoef/customBeforeSteps

added more fine-grained control of custom_before_steps
parents acfb1f4c ed298c73
Branches
Tags
No related merge requests found
...@@ -86,7 +86,7 @@ Gitlab CI uses a .gitlab-ci.yml file in the root of your repository tell Gitlab ...@@ -86,7 +86,7 @@ Gitlab CI uses a .gitlab-ci.yml file in the root of your repository tell Gitlab
| custom_jobs |Define custom Gitlab CI jobs that will be executed. It is recommended that you use this option if you need customized Gitlab CI jobs. Please see the [.gitlab-ci.yml](https://docs.gitlab.com/ce/ci/yaml/README.html) docs for specifics.| | custom_jobs |Define custom Gitlab CI jobs that will be executed. It is recommended that you use this option if you need customized Gitlab CI jobs. Please see the [.gitlab-ci.yml](https://docs.gitlab.com/ce/ci/yaml/README.html) docs for specifics.|
| rubygems_mirror | Use a custom rubygems mirror url | | rubygems_mirror | Use a custom rubygems mirror url |
| image |Define the Docker image to use, when using the Docker runner. Please see the [Using Docker images](https://docs.gitlab.com/ee/ci/docker/using_docker_images.html) docs for specifics.| | image |Define the Docker image to use, when using the Docker runner. Please see the [Using Docker images](https://docs.gitlab.com/ee/ci/docker/using_docker_images.html) docs for specifics.|
| custom_before_steps |Allows you to pass additional steps to the GitLab CI before_script. Please see the [.gitlab-ci.yml](https://docs.gitlab.com/ce/ci/yaml/#before_script-and-after_script) docs for specifics.| | custom_before_steps |Allows you to pass additional steps to the GitLab CI before_script. Please see the [.gitlab-ci.yml](https://docs.gitlab.com/ce/ci/yaml/#before_script-and-after_script) docs for specifics. If given as an array, the steps are executed _before_ the default steps of the before_script. If you want to have more control over the execution order of the steps, you can define a hash with a `before` and/or `after` key holding an array of steps to be executed before and after the default_script respectively.|
| default_before_script |If false, removes the default `before_script` section. Useful if you need a customised Bundler install, or to remove Bundler entirely. If the key is unset the default behaviour is to add `before_script`.| | default_before_script |If false, removes the default `before_script` section. Useful if you need a customised Bundler install, or to remove Bundler entirely. If the key is unset the default behaviour is to add `before_script`.|
|use_litmus| By default it is disabled. Set to `true` to configure travis to use Litmus testing tool for acceptance testing jobs with default values.| |use_litmus| By default it is disabled. Set to `true` to configure travis to use Litmus testing tool for acceptance testing jobs with default values.|
|litmus|Allows you to update default config values. Its sub keys are `provision_list`, `puppet_collection`, `ruby_version`, `install_wget` which are detailed below.| |litmus|Allows you to update default config values. Its sub keys are `provision_list`, `puppet_collection`, `ruby_version`, `install_wget` which are detailed below.|
......
...@@ -56,8 +56,13 @@ default: ...@@ -56,8 +56,13 @@ default:
<% 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 before_script: &before_script
<% if configs['custom_before_steps'] -%> <% if configs['custom_before_steps'] -%>
<% configs['custom_before_steps'].each do |step| -%> <% if configs['custom_before_steps'].is_a? Array -%>
<% configs['custom_before_steps'] = { 'before' => configs['custom_before_steps'] } -%>
<% end -%>
<% if configs['custom_before_steps']['before'] -%>
<% configs['custom_before_steps']['before'].each do |step| -%>
- <%= step %> - <%= step %>
<% end -%>
<% end -%> <% end -%>
<% end -%> <% end -%>
- bundle -v - bundle -v
...@@ -74,6 +79,11 @@ default: ...@@ -74,6 +79,11 @@ default:
- gem --version - gem --version
- bundle -v - bundle -v
- bundle install <%= configs['bundler_args'] %> - bundle install <%= configs['bundler_args'] %>
<% if configs['custom_before_steps'] and configs['custom_before_steps']['after'] -%>
<% configs['custom_before_steps']['after'].each do |step| -%>
- <%= step %>
<% end -%>
<% end -%>
<% 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