rapid7 / builderator

Tools to make CI Packer builds awesome
MIT License
23 stars 9 forks source link

Fix #112 - Support vendoring URL resources #113

Closed erran-r7 closed 7 years ago

erran-r7 commented 7 years ago

Fix #112 — Add a new url source to the vendor collection.

cc @anowak-r7 @vchaudhari-r7 Internally you guys may be able to use this to pull resources into your AMI using a buildfile like we do for regular services. I'll ping you more specifically in our private chat (vs. this open source issue).

erran-r7 commented 7 years ago

Validated these changes using the following changes to my Gemfile/Buildfile and running bundle exec build prepare:

diff --git a/Buildfile b/Buildfile
index df5675f..96ca867 100644
--- a/Buildfile
+++ b/Buildfile
@@ -3,6 +3,11 @@ build_number ENV.fetch('BUILD_NUMBER', 0) ## From Jenkins

 autoversion.create_tags true

+vendor 'example.config.xml' do |v|
+  v.url 'https://github.com/rwilliams-r7/ignite/raw/765d1c4fd6135a435570a023ce6c698c7e6f28f0/example.config.xml'
+end
+puts vendored('example.config.xml')
+
 cookbook.depends 'rapid7-ignite' do |cookbook|
   # See: https://github.com/rapid7/chef-rapid7-consul/blob/master/Buildfile#L10-L13
   if ENV['BAKING']
diff --git a/Gemfile b/Gemfile
index a66d943..2f11aef 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,3 @@
 source 'https://rubygems.org'

-gem 'builderator', '~> 1.0'
\ No newline at end of file
+gem 'builderator', github: 'erran/builderator', branch: 'issue-112/support-vendoring-files-by-url'
$ head .builderator/vendor/example.config.xml 
<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at