ops_tasks 0.4.3 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eab2ec03b9aa9a8741a9fb34d717617c578333a9
4
- data.tar.gz: 5d815350ddaf2fdfa94b57a10d5a9bf74cb87880
3
+ metadata.gz: d8c914d3d350acedc716cc953d07ed91ed85d8bd
4
+ data.tar.gz: c6b3b7114f9ad10569be9bbd68b8f807378db224
5
5
  SHA512:
6
- metadata.gz: a07f9941ac19f766c77d75816115f01bc2516afe0c662f72f313a7727b6813a9943184b006d45e93366844d2d043599ffea45eac648f5939c32fb72c064e36c0
7
- data.tar.gz: 1205ec07abf44398422cb98231dfafdb68a34da804f3c4de7bc7553ff705d0be7c3bd1b44e77cf3b9da7e80742d291762adc881c623f9c09583532b543c8166e
6
+ metadata.gz: 10e1c429b44a5d6529dc18189e843c80ee5e75266f6baacdcc392b5075d6c69d7ead5366ebe65b305f2be660f92bea23a7b39293af689c0f4b442e1da887cba7
7
+ data.tar.gz: 53b95fe5cad439f774cb9de5253e094f2ac2b3753c82a7cbfd07544e5a571c83cc3bed2fbb315e0f600f14390522ce5b45a33673b2d9e384f5f92164ee4a24f5
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ops Tasks
2
2
 
3
- Provides your rails project with rake tasks for deploying to AWS via Opsworks
3
+ Provides your project with rake tasks for deploying to AWS via Opsworks
4
4
 
5
5
  - Alerts Slack channel that deployment is starting
6
6
  - Initiates a deployment on Opsworks
@@ -12,7 +12,11 @@ Provides your rails project with rake tasks for deploying to AWS via Opsworks
12
12
  #### Add gem & source
13
13
 
14
14
  # Gemfile
15
- gem 'ops_tasks'
15
+ gem 'ops_tasks', '~> 0.4'
16
+
17
+ #### or install
18
+
19
+ gem install 'ops_tasks'
16
20
 
17
21
  #### Find your AWS IAM Credentials
18
22
 
@@ -26,7 +30,6 @@ Then click 'Manage Access Keys' and create a new Access Key. The secret key will
26
30
 
27
31
  These are listed on the settings or details page for stacks and instances, and they're called _Opsworks ID_.
28
32
 
29
-
30
33
  #### Setup your environment variables as follows:
31
34
 
32
35
  | variable name | description |
@@ -54,18 +57,31 @@ your_server_name_slack_channel
54
57
  your_server_name_room_notifications
55
58
  ```
56
59
 
57
- You can use figaro or dotenv. I prefer figaro.
60
+ You can use [figaro](https://github.com/laserlemon/figaro) or [dotenv](https://github.com/bkeepers/dotenv). I prefer figaro.
61
+
62
+ #### Ruby Setup (without rails)
63
+
64
+ 1. If using figaro, add your `application.yml` file to the `./config/` directory (create one).
65
+ 1. If using dotenv, use a `.env` file in the root of your project.
66
+ 1. To generate a dotenv file, run the command
67
+
68
+ ops_tasks init
69
+
70
+ 1. To add a deploy environment, run the command
71
+
72
+ ops_tasks add <environment name>
73
+
74
+ ## Usage (With Rails)
58
75
 
59
- ## Usage
76
+ If you only have one deployment environment in your env file, ops_tasks will run that one automatically. If more than one exists, ops_tasks will prompt you via a graphical menu.
60
77
 
61
78
  ### Update Cookbooks
62
79
 
63
- rake staging:update_cookbooks
64
- rake production:update_cookbooks
80
+ bundle exec rake ops_tasks:update_cookbooks
65
81
 
66
82
  ### Deploy to AWS
67
83
 
68
- bundle exec rake deploy
84
+ bundle exec rake ops_tasks:deploy
69
85
 
70
86
  Select a server...
71
87
  1. staging
@@ -77,5 +93,28 @@ You can use figaro or dotenv. I prefer figaro.
77
93
  Sidekiq Server: Preparing deployment... successful
78
94
  Sidekiq Server: Running... successful
79
95
 
96
+ ### Run Configuration Recipes
97
+
98
+ bundle exec rake ops_tasks:configure
99
+
100
+ ### Run Setup Recipes
101
+
102
+ bundle exec rake ops_tasks:setup
103
+
104
+ ## Usage (Without Rails)
105
+
106
+ Run any of these tasks from your project directory
107
+
108
+ # Run the deploy recipe noted in your env
109
+ ops_tasks deploy
110
+
111
+ # Run the setup recipe(s) as listed in your OpsWorks Layer
112
+ ops_tasks setup
113
+
114
+ # Update your cookbooks on OpsWorks
115
+ ops_tasks update_cookbooks
116
+
117
+ # Run the configure recipe(s) as listed in your OpsWorks Layer
118
+ ops_tasks configure
80
119
 
81
120
 
data/bin/ops_tasks CHANGED
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'ops_tasks'
4
+ # require_relative '../lib/ops_tasks'
4
5
  require 'highline/import'
5
6
  require 'dotenv'
6
7
 
7
- Dotenv.load
8
+ # Dotenv.load if OpsTasks::CliHelper.detect_env == 'dotenv'
9
+ # Figaro.load if OpsTasks::CliHelper.detect_env == 'dotenv'
10
+ OpsTasks::CliHelper.load_env
8
11
 
9
12
  if ARGV[0] == 'init'
10
13
  `touch .env`
@@ -0,0 +1,24 @@
1
+ require 'figaro'
2
+ require 'dotenv'
3
+
4
+ module OpsTasks
5
+ class CliHelper
6
+ def self.detect_env
7
+ return 'dotenv' if File.file?("#{Dir.pwd}/.env")
8
+ return 'figaro' if File.file?("#{Dir.pwd}/config/application.yml")
9
+ end
10
+
11
+ def self.load_env
12
+ Dotenv.load if detect_env == 'dotenv'
13
+ load_figaro if detect_env == 'figaro'
14
+ end
15
+
16
+ def self.load_figaro
17
+ Figaro.application = Figaro::Application.new(
18
+ environment: "production",
19
+ path: "#{Dir.pwd}/config/application.yml"
20
+ )
21
+ Figaro.load
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module OpsTasks
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
data/lib/ops_tasks.rb CHANGED
@@ -2,5 +2,6 @@ module OpsTasks
2
2
  require 'ops_tasks/railtie' if defined?(Rails)
3
3
  require 'ops_tasks/deployment'
4
4
  require 'ops_tasks/rake_helper'
5
+ require 'ops_tasks/cli_helper'
5
6
  require 'ops_tasks/version'
6
7
  end
data/ops_tasks.gemspec CHANGED
@@ -23,5 +23,6 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency "say2slack", "~> 0"
24
24
  s.add_dependency "highline", "~> 1"
25
25
  s.add_dependency "dotenv", "~> 0"
26
+ s.add_dependency "figaro", "~> 1"
26
27
 
27
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Prokesch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: figaro
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1'
69
83
  description: AWS Opsworks Rake & CLI Tasks for Deployment
70
84
  email:
71
85
  - nick@prokes.ch
@@ -76,6 +90,7 @@ extra_rdoc_files: []
76
90
  files:
77
91
  - ".gitignore"
78
92
  - ".ruby-verion"
93
+ - ".ruby-version"
79
94
  - Gemfile
80
95
  - Gemfile.lock
81
96
  - MIT-LICENSE
@@ -83,6 +98,7 @@ files:
83
98
  - Rakefile
84
99
  - bin/ops_tasks
85
100
  - lib/ops_tasks.rb
101
+ - lib/ops_tasks/cli_helper.rb
86
102
  - lib/ops_tasks/deployment.rb
87
103
  - lib/ops_tasks/railtie.rb
88
104
  - lib/ops_tasks/rake_helper.rb