slnky 0.1.2 → 0.1.3

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: acc37fe3483c5f7e0518647551a51fe02ac34565
4
- data.tar.gz: 00b8e90e46939f377eb1c270b05cce8da8867543
3
+ metadata.gz: 05b98c0cdeefc097d519c3ac0062ca6031068f5e
4
+ data.tar.gz: 95bd2e832436345263e59999aecc93d145c7add2
5
5
  SHA512:
6
- metadata.gz: 240f7ff913feb126255406722417bb647fb1865422e66ae1a4771859ed02e0d92357d9b8ce9494b7dc3d5d3d7535384a3688200ed8df870558089f53e5ac2bd5
7
- data.tar.gz: 5c0df5b7e2d4b858ed2b60f9e22da5b26fddfa1cf7219754e40c6ebb82d6d1476c4f2db1f058d0649086e85a4806a5d0c68b7f73ffb3e5323911c2f1935796d7
6
+ metadata.gz: bf6e3244020fe0410fdd85ca393f2b2c2102f977fe602c36080c404f22aa69d666f2f0b25b0c1ffef0d3ded0fc80e3365b997accd83cc2a7c437f3501b235777
7
+ data.tar.gz: e53ef3ea5ee3ff29fd6819ce6cdb0d1ad56ece14a2c601c754ec4043cfc8623bbe9313b5b13dabb0f456e883cd017052bb6f4b262ba475717a54e181bc24724e
@@ -1,6 +1,6 @@
1
1
  namespace :load do
2
2
  task :defaults do
3
- set :slnky_service, ->{ "slnky_#{fetch(:application)}_#{fetch(:stage)}" }
3
+ set :slnky_service, -> { "#{fetch(:application)}_#{fetch(:stage)}" }
4
4
  set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids')
5
5
  end
6
6
  end
@@ -8,7 +8,11 @@ end
8
8
  namespace :slnky do
9
9
  desc 'upload local upstart config from upstart/init.conf'
10
10
  task :config do
11
- upload! "upstart/init.conf", "/etc/init.d/#{slnky_service}.conf"
11
+ on roles :app do
12
+ service = fetch(:slnky_service)
13
+ upload! "upstart/init.conf", "/tmp/#{service}.conf"
14
+ sudo 'mv', "/tmp/#{service}.conf", "/etc/init.d/#{service}.conf"
15
+ end
12
16
  end
13
17
 
14
18
  [:start, :stop, :restart].each do |command|
@@ -1,2 +1,8 @@
1
1
  # SLNKY Services just need to know the server to get their configuration
2
2
  SLNKY_URL="https://domain.com"
3
+
4
+ DEPLOY_DIR=/srv
5
+ DEPLOY_PROD_SERVER=hostname.domain.com
6
+ DEPLOY_PROD_USER=username
7
+ DEPLOY_STG_SERVER=staging.domain.com
8
+ DEPLOY_STG_USER=username
@@ -22,6 +22,7 @@ require 'capistrano/bundler'
22
22
  # require 'capistrano/rails/assets'
23
23
  # require 'capistrano/rails/migrations'
24
24
  # require 'capistrano/passenger'
25
+ require 'airbrussh/capistrano'
25
26
  require 'capistrano/slnky'
26
27
 
27
28
  # Load custom tasks from `lib/capistrano/tasks` if you have any defined
@@ -1,61 +1,2 @@
1
- # server-based syntax
2
- # ======================
3
- # Defines a single server with a list of roles and multiple properties.
4
- # You can define all roles on a single server, or split them:
5
-
6
- # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7
- # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8
- # server 'db.example.com', user: 'deploy', roles: %w{db}
9
-
10
-
11
-
12
- # role-based syntax
13
- # ==================
14
-
15
- # Defines a role with one or multiple servers. The primary server in each
16
- # group is considered to be the first unless any hosts have the primary
17
- # property set. Specify the username and a domain or IP for the server.
18
- # Don't use `:all`, it's a meta role.
19
-
20
- # role :app, %w{deploy@example.com}, my_property: :my_value
21
- # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22
- # role :db, %w{deploy@example.com}
23
-
24
-
25
-
26
- # Configuration
27
- # =============
28
- # You can set any configuration variable like in config/deploy.rb
29
- # These variables are then only loaded and set in this stage.
30
- # For available Capistrano configuration variables see the documentation page.
31
- # http://capistranorb.com/documentation/getting-started/configuration/
32
- # Feel free to add new variables to customise your setup.
33
-
34
-
35
-
36
- # Custom SSH Options
37
- # ==================
38
- # You may pass any option but keep in mind that net/ssh understands a
39
- # limited set of options, consult the Net::SSH documentation.
40
- # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
41
- #
42
- # Global options
43
- # --------------
44
- # set :ssh_options, {
45
- # keys: %w(/home/rlisowski/.ssh/id_rsa),
46
- # forward_agent: false,
47
- # auth_methods: %w(password)
48
- # }
49
- #
50
- # The server-based syntax can be used to override options:
51
- # ------------------------------------
52
- # server 'example.com',
53
- # user: 'user_name',
54
- # roles: %w{web app},
55
- # ssh_options: {
56
- # user: 'user_name', # overrides user setting above
57
- # keys: %w(/home/user_name/.ssh/id_rsa),
58
- # forward_agent: false,
59
- # auth_methods: %w(publickey password)
60
- # # password: 'please use keys'
61
- # }
1
+ set :stage, :production
2
+ server ENV['DEPLOY_PROD_SERVER'], user: ENV['DEPLOY_PROD_USER'], roles: %w{web app}
@@ -1,61 +1,2 @@
1
- # server-based syntax
2
- # ======================
3
- # Defines a single server with a list of roles and multiple properties.
4
- # You can define all roles on a single server, or split them:
5
-
6
- # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7
- # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8
- # server 'db.example.com', user: 'deploy', roles: %w{db}
9
-
10
-
11
-
12
- # role-based syntax
13
- # ==================
14
-
15
- # Defines a role with one or multiple servers. The primary server in each
16
- # group is considered to be the first unless any hosts have the primary
17
- # property set. Specify the username and a domain or IP for the server.
18
- # Don't use `:all`, it's a meta role.
19
-
20
- # role :app, %w{deploy@example.com}, my_property: :my_value
21
- # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22
- # role :db, %w{deploy@example.com}
23
-
24
-
25
-
26
- # Configuration
27
- # =============
28
- # You can set any configuration variable like in config/deploy.rb
29
- # These variables are then only loaded and set in this stage.
30
- # For available Capistrano configuration variables see the documentation page.
31
- # http://capistranorb.com/documentation/getting-started/configuration/
32
- # Feel free to add new variables to customise your setup.
33
-
34
-
35
-
36
- # Custom SSH Options
37
- # ==================
38
- # You may pass any option but keep in mind that net/ssh understands a
39
- # limited set of options, consult the Net::SSH documentation.
40
- # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
41
- #
42
- # Global options
43
- # --------------
44
- # set :ssh_options, {
45
- # keys: %w(/home/rlisowski/.ssh/id_rsa),
46
- # forward_agent: false,
47
- # auth_methods: %w(password)
48
- # }
49
- #
50
- # The server-based syntax can be used to override options:
51
- # ------------------------------------
52
- # server 'example.com',
53
- # user: 'user_name',
54
- # roles: %w{web app},
55
- # ssh_options: {
56
- # user: 'user_name', # overrides user setting above
57
- # keys: %w(/home/user_name/.ssh/id_rsa),
58
- # forward_agent: false,
59
- # auth_methods: %w(publickey password)
60
- # # password: 'please use keys'
61
- # }
1
+ set :stage, :staging
2
+ server ENV['DEPLOY_STG_SERVER'], user: ENV['DEPLOY_STG_USER'], roles: %w{web app}
@@ -4,6 +4,15 @@ lock '3.4.0'
4
4
  set :application, '<%= dir %>'
5
5
  set :repo_url, 'git@github.com:something/<%= dir %>.git'
6
6
 
7
+ rubyversion = File.read('.ruby-version').chomp
8
+ rubygemset = File.read('.ruby-gemset').chomp
9
+
10
+ set :deploy_to, "#{ENV['DEPLOY_DIR']}/#{fetch(:application)}#{fetch(:stage) == 'staging' ? '-stg' : ''}"
11
+
12
+ set :keep_releases, 5
13
+
14
+ set :rvm_ruby_version, "#{rubyversion}@#{rubygemset}" # Defaults to: 'default'
15
+
7
16
  # Default branch is :master
8
17
  # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
9
18
 
data/lib/slnky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slnky
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slnky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Catanzarite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-03 00:00:00.000000000 Z
11
+ date: 2016-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler