Commit 8773b691 authored by Colin Shea's avatar Colin Shea

Simplified the directory output structure

specify the output directory in config.yaml
parent 37b196d8
named_conf: ./pdns_zones
zones_dir: ./output
ruby_zones: ./zones/
templates: ./templates/
output: ./generated/
# Command to run after push
execute: '/bin/echo happy'
......
......@@ -2,11 +2,6 @@
class ZoneGenerator
def initialize(basedir)
@generated = "#{basedir}/tmp/generated"
@tmp_named = "#{@generated}/named.conf"
@tmp_zones = "#{@generated}/zones"
@config = YAML.load_file("config.yaml")
@config.deep_symbolize_keys!
@soa = {
......@@ -22,6 +17,10 @@ class ZoneGenerator
@zones_dir = File.expand_path(@config[:ruby_zones])
@template_dir = File.expand_path(@config[:templates])
@generated = File.expand_path(@config[:generated])
@tmp_named = "#{@generated}/named.conf"
@tmp_zones = "#{@generated}/zones"
# Rewrite email address
if (email = @soa[:email]).include?("@")
......@@ -86,12 +85,6 @@ class ZoneGenerator
end
def deploy
# Remove zones directory
FileUtils.rm_rf @config[:zones_dir]
FileUtils.copy @tmp_named, @config[:named_conf]
FileUtils.copy_entry @tmp_zones, @config[:zones_dir]
cmd = @config[:execute]
print "Executing '#{cmd}' ... "
out = `#{cmd}`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment