cap-bedrock 0.0.0 → 0.1.0

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: 411d27e25e100172f96beb9dad5b0bd31190142f
4
- data.tar.gz: 560c2f640a6c5bbf188c973684966d357452a52c
3
+ metadata.gz: 1d2688768bd168f5340b9ad5e187504789ae0b98
4
+ data.tar.gz: 84201f963c52ab1493a0666e0a793889e4d3ff3c
5
5
  SHA512:
6
- metadata.gz: fc3ddd572491d5133883798cab73f8434f316a1a38e9174930f00059bffd51ce58ae534bd8fb627b6563fdf85c6e103e437f60d42f65dab6d9fb42f6088264b5
7
- data.tar.gz: 8cfb396b0d423b5f37721d35e725130775a5867ccd86f8f9ffbe2e4b670705e5e7ae7691636b6dadea7a17bf75deaf6640ed29b16aa8ace0da8ccc609a606c30
6
+ metadata.gz: 74c7acce4c2e0d6cd6835c47b16f92821cb312142b08d7620e0e20f598c283eba799f1ae1e9e7864c5ee46203ad67a54eaee95faa45d067f17d6a1fbb2181e70
7
+ data.tar.gz: bfb27c20505df0396645aafd835861f6710fa9157ac9acde88b72ac86257bbdd83347ec9bdf0c852cdceeb5ed8ecb6ec643acb6ad3d11ae2f7719eec5964425e
@@ -1,61 +1,30 @@
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
-
1
+ set :stage, :production
10
2
 
11
-
12
- # role-based syntax
3
+ # Simple Role Syntax
13
4
  # ==================
5
+ #role :app, %w{deploy@example.com}
6
+ #role :web, %w{deploy@example.com}
7
+ #role :db, %w{deploy@example.com}
14
8
 
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.
9
+ # Extended Server Syntax
10
+ # ======================
11
+ SSHKit.config.command_map[:composer] = "~/bin/composer"
12
+ SSHKit.config.command_map[:npm] = "~/.nvm/v0.10.38/bin/npm"
33
13
 
14
+ set :deploy_to, -> { "/home/psurgery/#{fetch(:application)}" }
15
+ set :tmp_dir, "/home/psurgery/tmp"
34
16
 
17
+ server 'pssurgery.com', user: 'psurgery', roles: %w{web app db}
35
18
 
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
- # --------------
19
+ # you can set custom ssh options
20
+ # it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
21
+ # you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
22
+ # set it globally
44
23
  # set :ssh_options, {
45
- # keys: %w(/home/rlisowski/.ssh/id_rsa),
24
+ # keys: %w(~/.ssh/id_rsa),
46
25
  # forward_agent: false,
47
26
  # auth_methods: %w(password)
48
27
  # }
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
- # }
28
+
29
+ fetch(:default_env).merge!(wp_env: :production)
30
+
data/config/deploy.rb CHANGED
@@ -1,48 +1,108 @@
1
- # config valid only for current version of Capistrano
2
- lock '3.4.0'
1
+ set :application, 'pssurgery-com-bedrock'
2
+ set :repo_url, 'git@gitlab.immense.net:ps-surgical-hospital/pssurgery-com-bedrock.git'
3
+ set :theme_name, 'pssurgery'
4
+ # Branch options
5
+ # Prompts for the branch name (defaults to current branch)
6
+ #ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
3
7
 
4
- set :application, 'my_app_name'
5
- set :repo_url, 'git@example.com:me/my_repo.git'
8
+ # Hardcodes branch to always be master
9
+ # This could be overridden in a stage config file
10
+ set :branch, :master
6
11
 
7
- # Default branch is :master
8
- # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
9
12
 
10
- # Default deploy_to directory is /var/www/my_app_name
11
- # set :deploy_to, '/var/www/my_app_name'
13
+ # Use :debug for more verbose output when troubleshooting
14
+ set :log_level, :debug
12
15
 
13
- # Default value for :scm is :git
14
- # set :scm, :git
16
+ # Apache users with .htaccess files:
17
+ # it needs to be added to linked_files so it persists across deploys:
18
+ set :linked_files, fetch(:linked_files, []).push('.env', 'web/.htaccess')
19
+ set :linked_files, fetch(:linked_files, []).push('.env')
20
+ set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')
15
21
 
16
- # Default value for :format is :pretty
17
- # set :format, :pretty
18
22
 
19
- # Default value for :log_level is :debug
20
- # set :log_level, :debug
21
23
 
22
- # Default value for :pty is false
23
- # set :pty, true
24
+ namespace :deploy do
25
+ desc 'Restart application'
26
+ task :restart do
27
+ on roles(:app), in: :sequence, wait: 5 do
28
+ # Your restart mechanism here, for example:
29
+ # execute :service, :nginx, :reload
30
+ end
31
+ end
32
+ end
33
+
34
+ # The above restart task is not run by default
35
+ # Uncomment the following line to run it on deploys if needed
36
+ # after 'deploy:publishing', 'deploy:restart'
24
37
 
25
- # Default value for :linked_files is []
26
- # set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
38
+ namespace :deploy do
39
+ desc 'Update WordPress template root paths to point to the new release'
40
+ task :update_option_paths do
41
+ on roles(:app) do
42
+ within fetch(:release_path) do
43
+ if test :wp, :core, 'is-installed'
44
+ [:stylesheet_root, :template_root].each do |option|
45
+ # Only change the value if it's an absolute path
46
+ # i.e. The relative path "/themes" must remain unchanged
47
+ # Also, the option might not be set, in which case we leave it like that
48
+ value = capture :wp, :option, :get, option, raise_on_non_zero_exit: false
49
+ if value != '' && value != '/themes'
50
+ execute :wp, :option, :set, option, fetch(:release_path).join('web/wp/wp-content/themes')
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
27
58
 
28
- # Default value for linked_dirs is []
29
- # set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
59
+ # The above update_option_paths task is not run by default
60
+ # Note that you need to have WP-CLI installed on your server
61
+ # Uncomment the following line to run it on deploys if needed
62
+ # after 'deploy:publishing', 'deploy:update_option_paths'
30
63
 
31
- # Default value for default_env is {}
32
- # set :default_env, { path: "/opt/ruby/bin:$PATH" }
33
64
 
34
- # Default value for keep_releases is 5
35
- # set :keep_releases, 5
36
65
 
66
+ #bower install locally and push up bower_components
37
67
  namespace :deploy do
38
68
 
39
- after :restart, :clear_cache do
40
- on roles(:web), in: :groups, limit: 3, wait: 10 do
41
- # Here we can do anything such as:
42
- # within release_path do
43
- # execute :rake, 'cache:clear'
44
- # end
69
+ # Theme path
70
+ set :theme_path, Pathname.new('web/app/themes').join(fetch(:theme_name))
71
+
72
+ # Local Paths
73
+ set :local_theme_path, Pathname.new(File.dirname(__FILE__)).join('../').join(fetch(:theme_path))
74
+ set :local_bower_path, fetch(:local_theme_path).join('bower_components')
75
+
76
+ task :compile do
77
+ run_locally do
78
+ within fetch(:local_theme_path) do
79
+ execute :bower, 'install'
80
+ end
45
81
  end
46
82
  end
47
83
 
84
+ task :copy do
85
+ on roles(:web) do
86
+
87
+ # Remote Paths (Lazy-load until actual deploy)
88
+ set :remote_bower_path, -> { release_path.join(fetch(:theme_path)).join('bower_components') }
89
+
90
+ info " Your local bower components path: #{fetch(:local_bower_path)} "
91
+ info " Boom!!! Your remote distribution path: #{fetch(:remote_bower_path)} "
92
+ info " Uploading files to remote "
93
+ upload! fetch(:local_bower_path).to_s, fetch(:remote_bower_path), recursive: true
94
+ end
95
+ end
96
+
97
+ task assets: %w(compile copy)
48
98
  end
99
+
100
+
101
+
102
+ after 'deploy:updated', 'deploy:assets'
103
+
104
+
105
+
106
+ # Npm, Bower, Gulp
107
+ set :npm_target_path, -> { release_path.join('web/app/themes/pssurgery') }
108
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap-bedrock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Blaise