capistrano-teller 0.1.0 → 0.2.1

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: e2da8f634c3d65d7597f947fd59669b8d63b4e62864ee87af759d62a3fc339cb
4
- data.tar.gz: 39cf724a9b940cbaf0f9cbdd28ed62fdf9e6a05779f3378d9b68c9478d426428
3
+ metadata.gz: ae704f6188f3a40cc6b873f99217152b4b882fd2c7bea412ab46ae0f082dbd6c
4
+ data.tar.gz: c58692379d8070192bbf55d429d2335d3f154b7909546e08de17c4d7d3b5eaf5
5
5
  SHA512:
6
- metadata.gz: e74fd4a26d78a82717d79dfb11a8a322fb727650da60bce97eb66bce57ae6ed4b2bdf84a96b553a5c895646728f8cc3c8f241b6b76ddafd8e7a00132d2c935d4
7
- data.tar.gz: e189bbcb908e40306d25fa3ca78bbc91571114a0f68893e436c150f20e611dc90d0759c6eca21d6b541fbde051222acd70f13015c5ba99db2b3a40143bdcba61
6
+ metadata.gz: 95c4ff7e40c83c0f195f7047682f2c5543d0fda6afd890002606474cbe5ac28e52fd323c946099a9caa79c5ce7d24d60b78320631c1bc5a5b9bc10fdf20a23f3
7
+ data.tar.gz: cffe4244a22d48eb7615ea14ca7591492814781dc82e62c6299325a8f58d81224ae74c0d732da6a1e36187f4b51eea5d3c318efcb74c4d95db6372c2975371d0
data/README.md CHANGED
@@ -1,24 +1,48 @@
1
1
  # Capistrano::Teller
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
3
+ ## Installation
4
4
 
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/teller`. To experiment with that code, run `bin/console` for an interactive prompt.
5
+ ```
6
+ bundle add capistrano-teller
7
+ ```
6
8
 
7
- ## Installation
9
+ **Add .teller.yml**
10
+ ```
11
+ providers:
12
+ aws_secretsmanager:
13
+ kind: aws_secretsmanager
14
+ maps:
15
+ - id: aws
16
+ path: {{ get_env(name="RAILS_ENV", default="development") }}/{{get_env(name="NORMALIZED_REPO", default='application')}}/environment
17
+ dotenv:
18
+ kind: dotenv
19
+ maps:
20
+ - id: 'dotenv'
21
+ path: .env.{{ get_env(name="RAILS_ENV", default="development") }}
22
+ ```
8
23
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
24
 
11
- Install the gem and add to the application's Gemfile by executing:
12
25
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
26
+ ## Usage
14
27
 
15
- If bundler is not being used to manage dependencies, install the gem by executing:
28
+ deploy.rb
29
+ ```
30
+ set :rails_env, -> { fetch(:stage) }
16
31
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
32
+ set :teller_config, -> { File.join(Dir.pwd, '.teller.yml')}
33
+ set :teller_environment, -> { fetch(:rails_env) }
34
+ set :teller_source_provider, 'aws_secretsmanager/aws'
35
+ set :teller_target_provider, 'dotenv/dotenv'
36
+ set :teller_identifier, -> { fetch(:application) }
18
37
 
19
- ## Usage
38
+ server 'i-404004040b', roles: [:whenever, :app, :web, :teller]
39
+ ```
40
+
41
+ ```
42
+ cap staging deploy
43
+ ```
20
44
 
21
- TODO: Write usage instructions here
45
+ Will generate `.env.#{:rails_env}` locally and copy it to the `shared_path` and link to the `current_release`
22
46
 
23
47
  ## Development
24
48
 
@@ -2,14 +2,13 @@
2
2
  namespace :teller do
3
3
 
4
4
  def teller(*args)
5
- puts "Executing: #{fetch(:teller_command)}"
6
5
  execute fetch(:teller_command), *args
7
6
  end
8
7
 
9
8
  desc "Copy the .env.environment to the server"
10
9
  task :copy do
11
10
  run_locally do
12
- with rails_env: fetch(:teller_environment) do
11
+ with(rails_env: fetch(:teller_environment), normalized_repo: fetch(:teller_identifier) )do
13
12
  execute :touch, ".env.#{fetch(:teller_environment)}"
14
13
  teller "--config #{fetch(:teller_config)}", :copy, "--from #{fetch(:teller_source_provider)}", "--to #{fetch(:teller_target_provider)}"
15
14
  end
@@ -18,12 +17,9 @@ namespace :teller do
18
17
 
19
18
  task :upload_environment_file do
20
19
  on roles(:teller) do
21
- puts "Uploading .env.#{fetch(:teller_environment)} to #{fetch(:teller_shared_path)}/config/teller.yml"
22
20
  upload! ".env.#{fetch(:teller_environment)}", "#{fetch(:teller_shared_path)}/config/teller.yml"
23
21
  end
24
22
 
25
- puts "#{fetch(:linked_files)}"
26
-
27
23
  run_locally do
28
24
  execute :rm, ".env.#{fetch(:teller_environment)}"
29
25
  end
@@ -45,6 +41,7 @@ namespace :load do
45
41
  set :teller_command, ->{ fetch(:teller_command_path).chomp }
46
42
  set :teller_environment, ->{ fetch :rails_env, fetch(:stage, "production") }
47
43
  set :teller_shared_path, ->{ fetch(:shared_path) }
44
+ set :teller_identifier, ->{ fetch(:application) }
48
45
  append :linked_files, ".env.#{fetch(:teller_environment)}"
49
46
  end
50
47
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module Teller
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
@@ -1,18 +1,17 @@
1
1
  # frozen_string_literal: true
2
-
3
2
  require "zeitwerk"
4
- loader = Zeitwerk::Loader.for_gem_extension(Capistrano::Teller)
5
- loader.setup # ready!
6
3
 
7
4
  module Capistrano
8
5
  module Teller
9
6
  class Error < StandardError; end
10
-
11
-
12
7
  end
13
8
  end
14
9
 
15
10
 
11
+ loader = Zeitwerk::Loader.for_gem_extension(Capistrano::Teller)
12
+ loader.setup # ready!
13
+
14
+
16
15
  if defined?(Capistrano::VERSION) && Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
17
16
  load File.expand_path("../teller/capistrano/tasks/teller.rake", __FILE__)
18
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-teller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spencer Markowski