ctpl 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/ctpl +3 -3
- data/lib/ctpl/{merger.rb → compiler.rb} +1 -1
- data/thor/{generate.thor → compile.thor} +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1582e3caaaf54e4db31340b289e25a1023644396ce36575a0ffee90751c85a2a
|
4
|
+
data.tar.gz: 6c42b97d4dcfa3752a1ccf29b8fa3c06847bdc187bca960d73e8b216acb569dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c6cb2870dc6f76469112c87ddc24ea6e5a5881daa064d7f827b82d1074bbcc9fc21b24367c1d2a6c473d87a1c3689ac0920796aca7c4c80831eaec0bd39c44e
|
7
|
+
data.tar.gz: 503d08b16c6bd69b826ad597afdd644018737129645381ca34e160b0c7e85cc4bbf8cca598f746b20cd253d14fbc08cbbb7a56916264dd21a96af51729c9a136
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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("
|
23
|
+
ARGV.unshift("compile")
|
24
24
|
ARGV.unshift("help")
|
25
|
-
elsif ARGV[0] != "
|
26
|
-
ARGV.unshift("
|
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,19 +1,19 @@
|
|
1
|
-
require 'ctpl/
|
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 '
|
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
|
11
|
+
def compile
|
12
12
|
baseFolder = options[:basefolder]
|
13
|
-
merger =
|
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.
|
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/
|
46
|
-
- 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
|