travis-ci / travis-yaml

parses, normalizes, validates and serializes your .travis.yml
http://yaml.travis-ci.org/
MIT License
170 stars 66 forks source link

Fine-grained cache_control & expires #103

Closed ivank closed 6 years ago

ivank commented 7 years ago

I believe the issue from https://github.com/travis-ci/dpl/issues/486 stems from here. I would gladly add a pull request though I couldn't seem to find out how to allow a sequence of maps

I've been working with this addition to spec/nodes/deploy_spec.rb:

specify 'with fine-grained cache_control' do
  config = Travis::Yaml.parse(deploy: { provider: :s3, cache_control: ["max-age=99999999", "no-cache-2", "no-cache" => ["foo.html", "bar.txt"], "max-age=9999" => "*.txt"] })
  expect(config.deploy.first['cache_control'])   .to be == ["max-age=99999999", "no-cache" => ["foo.html", "bar.txt"], "max-age=9999" => "*.txt"]
  expect(config.deploy.nested_warnings)          .to be_empty
end

It comes more-or-less straight from https://github.com/travis-ci/dpl/blob/master/spec/provider/s3_spec.rb#L108