ctpl 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca1add0374408646f0aaa0943a09d89cc42f7c1734c977bdc9e67338187c41ee
4
- data.tar.gz: 8f55ec0a9dafd96ecc33941eebae30cd05a88baeafc698fa25a6373275abe83e
3
+ metadata.gz: 1582e3caaaf54e4db31340b289e25a1023644396ce36575a0ffee90751c85a2a
4
+ data.tar.gz: 6c42b97d4dcfa3752a1ccf29b8fa3c06847bdc187bca960d73e8b216acb569dc
5
5
  SHA512:
6
- metadata.gz: 0fb07c7c4b0150653c7ed5887b36fd5343a846ff5039454504001e95454dd85665dacaab1dbc4fcd5e4b465355b1f40a2d6b08ac0939c009d6d6ae541565b7a0
7
- data.tar.gz: 9636e71ce1e6bd8373974185dd0c5695a2028376a53f090376881fa445d818eb3107835701b7baa221c1bb8d31ec9ddbb6fca34459563101f095f43730928c41
6
+ metadata.gz: 1c6cb2870dc6f76469112c87ddc24ea6e5a5881daa064d7f827b82d1074bbcc9fc21b24367c1d2a6c473d87a1c3689ac0920796aca7c4c80831eaec0bd39c44e
7
+ data.tar.gz: 503d08b16c6bd69b826ad597afdd644018737129645381ca34e160b0c7e85cc4bbf8cca598f746b20cd253d14fbc08cbbb7a56916264dd21a96af51729c9a136
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/bin/ctpl CHANGED
@@ -20,10 +20,10 @@ end
20
20
  begin
21
21
  # show the generate help by default
22
22
  if ARGV[0] == "help" || ARGV[0] == "--help" || ARGV[0] == "-?"
23
- ARGV.unshift("generate")
23
+ ARGV.unshift("compile")
24
24
  ARGV.unshift("help")
25
- elsif ARGV[0] != "generate" # default to generate if nothing else passed
26
- ARGV.unshift("generate")
25
+ elsif ARGV[0] != "compile" # default to generate if nothing else passed
26
+ ARGV.unshift("compile")
27
27
  end
28
28
 
29
29
  Ctpl::Generate.start(ARGV)
@@ -1,6 +1,6 @@
1
1
  require 'yaml'
2
2
 
3
- class PipelineMerger
3
+ class PipelineCompiler
4
4
  include Thor::Shell
5
5
 
6
6
  def initialize(mainPipelinePath, globalAliasesPath, partialsFolder)
@@ -1,19 +1,19 @@
1
- require 'ctpl/merger'
1
+ require 'ctpl/compiler'
2
2
 
3
3
  module Ctpl
4
4
  class Generate < Thor
5
5
  include Thor::Actions
6
6
  class_option :verbose, :type => :boolean, :aliases => '-v', :default => false, :banner => 'Activate verbose mode', :desc => 'If used show errors, stacktraces and more'
7
7
 
8
- desc 'generate', 'Handle all marked instances, either to install or install'
8
+ desc 'compile', 'Compile the pipeline.yaml file from the templates'
9
9
  method_option :basefolder, :aliases => 'b', :required => false, :type => :string, :default => './pipeline', :desc => "Optional - defaults to ./pipeline, falls back to PWD. The base-folder the pipeline.yaml, alias.yaml and the partials are located. \nIf you pass /tmp/foo we will look for /tmp/foo/pipeline.yaml, optionally for /tmp/foo/aliases.yaml and all /tmp/foo/*_.yaml files as partials"
10
10
  method_option :output, :aliases => 'o', :required => false, :type => :string, :default => './pipeline.yaml', :desc => "Optional, defaults to pipeline.yaml. Output path to save the merged yaml in"
11
- def generate
11
+ def compile
12
12
  baseFolder = options[:basefolder]
13
- merger = PipelineMerger.new("#{baseFolder}/pipeline.yaml", "#{baseFolder}/aliases.yaml", baseFolder)
13
+ merger = PipelineCompiler.new("#{baseFolder}/pipeline.yaml", "#{baseFolder}/aliases.yaml", baseFolder)
14
14
  p = merger.merge
15
15
  say_status 'ok', "Transforming back to yaml ", :white
16
- yaml = p.to_yaml
16
+ yaml = "# DO NOT CHANGE THIS FILE\n# Generated by ctp (https://github.com/EugenMayer/concourse-pipeline-templateer)\n# See '#{baseFolder}' for the source files\n" + p.to_yaml
17
17
  say_status 'ok', "Saving to #{options[:output]} ", :white
18
18
  File.write(options[:output], yaml)
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ctpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugen Mayer
@@ -42,8 +42,8 @@ files:
42
42
  - Thorfile
43
43
  - VERSION
44
44
  - bin/ctpl
45
- - lib/ctpl/merger.rb
46
- - thor/generate.thor
45
+ - lib/ctpl/compiler.rb
46
+ - thor/compile.thor
47
47
  homepage: https://github.com/EugenMayer/concourse-pipeline-templateer
48
48
  licenses:
49
49
  - GPL