handsome_fencer-circle_c_i 0.1.12 → 0.1.15

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: 3a4536073e8d98a4adaadb671df91de15ac1645d95fffd44aec476df402e28b3
4
- data.tar.gz: 88c97270624ff3d7de942b59143b6dc69d95b45852eddf596fcbcced353a24e1
3
+ metadata.gz: 92ff23b2b5c21e2939565cf4b4689b12f4b5e4c450e361c2fac928914adc7fb9
4
+ data.tar.gz: 356e4639b0b8248577438289ac70834202a08afd731fd5c94029817f78b085e7
5
5
  SHA512:
6
- metadata.gz: cae21dd0094dbf203f92e32384a6a1d2c959ed37a869fad3125227a9a4e59b05f85feb2105e0e67da5bee31020cd07e0e17848ce36cc8832159a8261e15d3aa3
7
- data.tar.gz: 9f9ec021ccb1c2bf59e2235c8296bf866382ec61373b85b45d121300dfea294da1080135445d148906a22f67352fd555554e42194855f88e79a807a9d49521a3
6
+ metadata.gz: e889a2514fccc6f3dd6df807a656c0818bcb55ce38468b60d1bdd0504e2ee0906ffaedd42480a5385b15cd9d5691e1e5ef27df15016151e6d106447e03161cb5
7
+ data.tar.gz: f401e1620733dfdd8bed3b1211747760f3b326969e0c7ae4a9a1492c1d3a7b76aeaba7c23fc3e8aecc09ec3039fdbef9763424095bbecdb72536ca80fc57dde3
data/Rakefile CHANGED
@@ -25,3 +25,6 @@ Rake::TestTask.new(:test) do |t|
25
25
  end
26
26
 
27
27
  task default: :test
28
+
29
+ import "lib/handsome_fencer/circle_c_i/tasks/generate_key.rake"
30
+ import "lib/handsome_fencer/circle_c_i/tasks/install.rake"
data/lib/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ # lib/Rakefile
2
+ require 'handsome_fencer-circle_c_i'
3
+ import "./lib/handsome_fencer/circle_c_i/tasks/generate_key.rake"
4
+ path = File.expand_path(__dir__)
5
+ Dir.glob("#{path}/tasks/**/*.rake").each { |f| import f }
@@ -0,0 +1,5 @@
1
+ # lib/Rakefile
2
+ require 'handsome_fencer/circle_c_i'
3
+
4
+ path = File.expand_path(__dir__)
5
+ Dir.glob("#{path}/tasks/**/*.rake").each { |f| import f }
@@ -0,0 +1,11 @@
1
+ module Socialinvestigator
2
+ module CLI
3
+ class Hn < Thor
4
+ desc "search URL", "Search hn.algolia.com for a url mentioned on Hackernews"
5
+ option :tags
6
+ def search( url )
7
+ puts "Looks like you are looking for #{url} with tags #{options[:tags]}"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,30 @@
1
+ require 'thor'
2
+ require 'handsome_fencer/circle_c_i/cli/hn'
3
+
4
+
5
+ module Socialinvestigator
6
+ class HammerOfTheGods < Thor
7
+ desc "hello NAME", "This will greet you"
8
+ long_desc <<-HELLO_WORLD
9
+
10
+ `hello NAME` will print out a message to the person of your choosing.
11
+
12
+ Brian Kernighan actually wrote the first "Hello, World!" program
13
+ as part of the documentation for the BCPL programming language
14
+ developed by Martin Richards. BCPL was used while C was being
15
+ developed at Bell Labs a few years before the publication of
16
+ Kernighan and Ritchie's C book in 1972.
17
+
18
+ http://stackoverflow.com/a/12785204
19
+ HELLO_WORLD
20
+ option :upcase
21
+ def hello( name )
22
+ greeting = "Hello, #{name}"
23
+ greeting.upcase! if options[:upcase]
24
+ puts greeting
25
+ end
26
+
27
+ desc "hn COMMANDS", "Hacker News Control Module"
28
+ subcommand "hn", Socialinvestigator::CLI::Hn
29
+ end
30
+ end
@@ -1,6 +1,5 @@
1
1
  require 'openssl'
2
2
  require 'base64'
3
- require 'byebug'
4
3
 
5
4
  module HandsomeFencer
6
5
  module CircleCI
@@ -0,0 +1,7 @@
1
+ require 'thor'
2
+ require 'thor/group'
3
+
4
+ class HandsomeFencer::CircleCI::Generator < Thor::Group
5
+ include Thor::Actions
6
+ desc 'Generate a new filesystem structure'
7
+ end
@@ -0,0 +1,46 @@
1
+ require 'handsome_fencer/circle_c_i/crypto'
2
+ require 'thor'
3
+ require 'optparse'
4
+
5
+ require 'byebug'
6
+
7
+ namespace :handsome_fencer do
8
+
9
+ class Hammer < Thor
10
+ include Thor::Actions
11
+ end
12
+
13
+ namespace :circle_c_i do
14
+
15
+ class Hammer < Thor
16
+ include Thor::Actions
17
+ end
18
+
19
+ desc "generate deploy key"
20
+
21
+ task :generate_key do
22
+
23
+ if ARGV.include?('--rakefile')
24
+ environment = ARGV[3]
25
+ directory = ARGV[4]
26
+ else
27
+ environment = ARGV[1]
28
+ directory = ARGV[2]
29
+ end
30
+
31
+ @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
32
+ @salt = '8 octets'
33
+ @new_key = @cipher.random_key
34
+
35
+ hammer :create_file, ".circleci/#{environment}.key", Base64.encode64(@new_key)
36
+
37
+ exit
38
+ end
39
+
40
+ end
41
+ private
42
+
43
+ def hammer(*args)
44
+ Hammer.new.send *args
45
+ end
46
+ end
@@ -0,0 +1,29 @@
1
+ require 'handsome_fencer/circle_c_i/crypto'
2
+ require 'thor'
3
+
4
+ namespace :handsome_fencer do
5
+
6
+ namespace :circle_c_i do
7
+
8
+ class Hammer < Thor
9
+ include Thor::Actions
10
+ end
11
+
12
+ desc "Sets up some necessary files for continuous deployments using docker and CircleCI"
13
+
14
+ task :install do
15
+
16
+ def copy_circle_templates
17
+ directory "circleci", "./.circleci", recursive: true
18
+ end
19
+
20
+ exit
21
+ end
22
+
23
+ private
24
+
25
+ def hammer(*args)
26
+ Hammer.new.send *args
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ require 'handsome_fencer/circle_c_i/crypto'
2
+ require 'thor'
3
+ namespace :handsome_fencer do
4
+
5
+ namespace :circle_c_i do
6
+
7
+ desc "Generaters necessary files for CI using Circle, Docker, and Rails"
8
+
9
+ task :obfuscate do
10
+
11
+ environment = ARGV[0].nil? ? 'deploy' : ARGV[0]
12
+ directory = ARGV[1].nil? ? '.circleci' : ARGV[1]
13
+
14
+ @cipher = HandsomeFencer::CircleCI::Crypto.new(dkfile: environment)
15
+ @cipher.obfuscate(directory, environment)
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module HandsomeFencer
2
2
  module CircleCI
3
- VERSION = '0.1.12'
3
+ VERSION = '0.1.15'
4
4
  end
5
5
  end
@@ -1,4 +1,6 @@
1
- require "handsome_fencer/circle_c_i/railtie"
1
+ # require "handsome_fencer/circle_c_i/railtie"
2
+ require "handsome_fencer/circle_c_i/version"
3
+ require "handsome_fencer/circle_c_i/cli"
2
4
  require "handsome_fencer/circle_c_i/crypto"
3
5
 
4
6
  module HandsomeFencer
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handsome_fencer-circle_c_i
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - schadenfred
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-01 00:00:00.000000000 Z
11
+ date: 2018-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sshkit
@@ -25,13 +25,27 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rails
28
+ name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
@@ -91,6 +105,7 @@ files:
91
105
  - MIT-LICENSE
92
106
  - README.md
93
107
  - Rakefile
108
+ - lib/Rakefile
94
109
  - lib/generators/handsome_fencer.rb
95
110
  - lib/generators/handsome_fencer/circle_c_i/deploy_key_generator.rb
96
111
  - lib/generators/handsome_fencer/circle_c_i/exposed_env_files_generator.rb
@@ -109,10 +124,15 @@ files:
109
124
  - lib/generators/handsome_fencer/circle_c_i/templates/docker-compose.yml
110
125
  - lib/generators/handsome_fencer/circle_c_i/templates/lib/tasks/deploy.rake
111
126
  - lib/handsome_fencer/circle_c_i.rb
127
+ - lib/handsome_fencer/circle_c_i/Rakefile
128
+ - lib/handsome_fencer/circle_c_i/cli.rb
129
+ - lib/handsome_fencer/circle_c_i/cli/hn.rb
112
130
  - lib/handsome_fencer/circle_c_i/crypto.rb
113
- - lib/handsome_fencer/circle_c_i/railtie.rb
131
+ - lib/handsome_fencer/circle_c_i/generators/install_generator.rb
132
+ - lib/handsome_fencer/circle_c_i/tasks/generate_key.rake
133
+ - lib/handsome_fencer/circle_c_i/tasks/install.rake
134
+ - lib/handsome_fencer/circle_c_i/tasks/obfuscate.rake
114
135
  - lib/handsome_fencer/circle_c_i/version.rb
115
- - lib/tasks/handsome_fencer/circle_c_i_tasks.rake
116
136
  homepage: https://github.com/schadenfred/handsome_fencer-circle_c_i
117
137
  licenses:
118
138
  - MIT
@@ -1,9 +0,0 @@
1
- module HandsomeFencer
2
- module CircleCI
3
- class Railtie < ::Rails::Railtie
4
- rake_tasks do
5
- load 'tasks/handsome_fencer/circle_c_i_tasks.rake'
6
- end
7
- end
8
- end
9
- end
@@ -1,17 +0,0 @@
1
- namespace "handsome_fencer" do
2
-
3
- # namespace "circleci" do
4
- #
5
- # @cipher = HandsomeFencer::CircleCI::Crypto.new
6
- #
7
- # desc "obfuscate .circleci variables"
8
- # task :obfuscate do
9
- # @cipher.obfuscate
10
- # end
11
- #
12
- # desc "expose .circleci variables"
13
- # task :expose do
14
- # @cipher.expose
15
- # end
16
- # end
17
- end