capistrano-teller 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -10
- data/lib/capistrano/teller/capistrano/tasks/teller.rake +3 -5
- data/lib/capistrano/teller/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f912d83e5558fdb92b617d370b0cf121195c6f453793c377139a1569ea302cc7
|
4
|
+
data.tar.gz: abad2ffb24dd881774d6f369c4a5745ca160af3d0d80976566a72223c8928419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddeabad21bceed794cfd2ecda3b9ae6aa41631cdc23f1d346af3d56b887c6dbd637694872cb7678960852604e49ba0b747e6525b90d1d1ed00ec5b78cfe08aad
|
7
|
+
data.tar.gz: d4500ebb72a83f7032354b96098fc7d62fb2d02a3675f93c7750a896a95b0524106e4c249b432e9c7209292487d72a027cb6faebfeaf88d607110faa0f32c1a9
|
data/README.md
CHANGED
@@ -1,24 +1,48 @@
|
|
1
1
|
# Capistrano::Teller
|
2
2
|
|
3
|
-
|
3
|
+
## Installation
|
4
4
|
|
5
|
-
|
5
|
+
```
|
6
|
+
bundle add capistrano-teller
|
7
|
+
```
|
6
8
|
|
7
|
-
|
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
|
-
|
26
|
+
## Usage
|
14
27
|
|
15
|
-
|
28
|
+
deploy.rb
|
29
|
+
```
|
30
|
+
set :rails_env, -> { fetch(:stage) }
|
16
31
|
|
17
|
-
|
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
|
-
|
38
|
+
server 'i-404004040b', roles: [:whenever, :app, :web, :teller]
|
39
|
+
```
|
40
|
+
|
41
|
+
```
|
42
|
+
cap staging deploy
|
43
|
+
```
|
20
44
|
|
21
|
-
|
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
|
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,8 @@ 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) }
|
45
|
+
append :default_env, "#{fetch(:teller_identifier)}"
|
48
46
|
append :linked_files, ".env.#{fetch(:teller_environment)}"
|
49
47
|
end
|
50
48
|
end
|