diff --git a/README.md b/README.md index 2af5a4923a732606005242deb93bb68adbbd8d99..325ad746f7d275c0fbcd305bc57a8d0be503b467 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ Gitlab CI uses a .gitlab-ci.yml file in the root of your repository tell Gitlab | 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.| | 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.| +| 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`.| ### .pdkignore diff --git a/config_defaults.yml b/config_defaults.yml index 3c1179eca72fe61fc9015ce498bcac30df4678df..fefb92492d7973fb414c0078504bc1b85a0a2b80 100644 --- a/config_defaults.yml +++ b/config_defaults.yml @@ -608,6 +608,7 @@ Gemfile: - parallel_spec puppet_version: '~> 5' # beaker: true + default_before_script: true spec/default_facts.yml: ipaddress: "172.16.254.254" ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" diff --git a/moduleroot/.gitlab-ci.yml.erb b/moduleroot/.gitlab-ci.yml.erb index f34cacf37907a48315127c02e01e4df7eecf7949..81d303fd1c6baa90b657b7292b7632c361d9bfc3 100644 --- a/moduleroot/.gitlab-ci.yml.erb +++ b/moduleroot/.gitlab-ci.yml.erb @@ -41,6 +41,7 @@ cache: <% end -%> <% end -%> +<% if !configs.has_key?('default_before_script') || configs['default_before_script'] -%> before_script: <% if configs['custom_before_steps'] -%> <% configs['custom_before_steps'].each do |step| -%> @@ -58,6 +59,7 @@ before_script: - gem --version - bundle -v - bundle install <%= configs['bundler_args'] %> +<% end -%> <% if configs['ruby_versions'] -%> <% configs['ruby_versions'].each do |ruby_version, options| -%>