cappress 0.1.1 → 0.2.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.
@@ -1,6 +1,8 @@
1
1
  # cappress
2
2
 
3
- Looking to deploy a [Wordpress](http://wordpress.org) application you've built? Cappress extends [Capistrano](http://capify.org), removing the *rails-ism*, replacing them by more *wp-ish* ones.
3
+ Looking to deploy a [Wordpress](http://wordpress.org) website? Cappress extends [Capistrano](http://capify.org), removing the *rails-ism*, replacing them by more *wp-ish* ones.
4
+
5
+ *Cloned from [Capcake](http://github.com/jadb/capcake)*
4
6
 
5
7
  ## Installation
6
8
 
@@ -88,11 +88,8 @@ Capistrano::Configuration.instance(:must_exist).load do
88
88
  task :setup, :except => { :no_release => true } do
89
89
  dirs = [deploy_to, releases_path, shared_path]
90
90
  dirs += shared_children.map { |d| File.join(shared_path, d) }
91
- tmp_dirs = tmp_children.map { |d| File.join(tmp_path, d) }
92
- tmp_dirs += cache_children.map { |d| File.join(cache_path, d) }
93
- run "#{try_sudo} mkdir -p #{(dirs + tmp_dirs).join(' ')} && #{try_sudo} chmod -R 777 #{tmp_path}" if (!user.empty?)
91
+ run "#{try_sudo} mkdir -p #{(dirs).join(' ')} && #{try_sudo} chmod -R 777 #{uploads_path}" if (!user.empty?)
94
92
  set :git_flag_quiet, "-q "
95
- cake.setup if (!cake_branch.empty?)
96
93
  end
97
94
 
98
95
  desc <<-DESC
@@ -414,27 +411,45 @@ Capistrano::Configuration.instance(:must_exist).load do
414
411
  on_rollback { run "rm #{config_path}" }
415
412
  puts "Wordpress Configuration"
416
413
  _cset :db_host, defaults(Capistrano::CLI.ui.ask("hostname [localhost]:"), 'localhost')
417
- _cset :db_login, defaults(Capistrano::CLI.ui.ask("username [#{user}]:"), user)
414
+ _cset :db_user, defaults(Capistrano::CLI.ui.ask("username [#{user}]:"), user)
418
415
  _cset :db_password, Capistrano::CLI.password_prompt("password:")
419
416
  _cset :db_name, defaults(Capistrano::CLI.ui.ask("db name [#{application}]:"), application)
420
- _cset :db_prefix, Capistrano::CLI.ui.ask("prefix [wp_]:")
417
+ _cset :db_prefix, defaults(Capistrano::CLI.ui.ask("prefix [wp_]:"), 'wp_')
421
418
  _cset :db_charset, defaults(Capistrano::CLI.ui.ask("charset []:"), '')
422
419
  _cset :db_collate, defaults(Capistrano::CLI.ui.ask("encoding []:"), '')
423
420
 
421
+ _cset :key_auth, defaults(Capistrano::CLI.ui.ask("Auth Key []:"), '')
422
+ _cset :key_secure, defaults(Capistrano::CLI.ui.ask("Secure Auth Key []:"), '')
423
+ _cset :key_logged_in, defaults(Capistrano::CLI.ui.ask("Logged In Key []:"), '')
424
+ _cset :key_nonce, defaults(Capistrano::CLI.ui.ask("Nonce Key []:"), '')
425
+ _cset :salt_auth, defaults(Capistrano::CLI.ui.ask("Auth Salt []:"), '')
426
+ _cset :salt_secure, defaults(Capistrano::CLI.ui.ask("Secure Auth Sal []t:"), '')
427
+ _cset :salt_logged_in, defaults(Capistrano::CLI.ui.ask("Logged In Salt []:"), '')
428
+ _cset :salt_nonce, defaults(Capistrano::CLI.ui.ask("Nonce Salt []:"), '')
429
+
430
+ _cset :wplang, defaults(Capistrano::CLI.ui.ask("WPLANG []:"), '')
431
+ _cset :wpdebug, defaults(Capistrano::CLI.ui.ask("WP_DEBUG [false]:"), 'false')
432
+
424
433
  template = File.read(File.join(File.dirname(__FILE__), "templates", "wp-config.rphp"))
425
434
  result = ERB.new(template).result(binding)
426
435
 
427
- put(result, "#{database_path}", :mode => 0644, :via => :scp)
436
+ put(result, "#{config_path}", :mode => 0644, :via => :scp)
428
437
  after("deploy:symlink", "wp:config:symlink")
429
438
  end
430
439
  desc <<-DESC
431
- Creates required CakePHP's APP/config/database.php as a symlink to \
432
- #{deploy_to}/shared/config/database.php
440
+ Creates required Wordpress's APP/wp-config.php as a symlink to \
441
+ #{deploy_to}/shared/wp-config.php
433
442
  DESC
434
443
  task :symlink, :roles => :web, :except => { :no_release => true } do
435
444
  run "#{try_sudo} ln -s #{config_path} #{current_path}/wp-config.php"
436
445
  end
437
446
  end
447
+ desc <<-DESC
448
+ Creates a symlink for Wordpress' 'uploads' directory
449
+ DESC
450
+ task :symlink, :roles => :web, :except => { :no_release => true } do
451
+ run "#{try_sudo} ln -s #{uploads_path} #{current_path}/wp-content/uploads"
452
+ end
438
453
  end
439
454
 
440
455
  end # Capistrano::Configuration.instance(:must_exist).load do
@@ -1,14 +1,90 @@
1
1
  <?php
2
- class DATABASE_CONFIG {
3
- public $default = array(
4
- 'driver' => '<%= db_driver %>',
5
- 'persistent' => '<%= db_persistent %>',
6
- 'host' => '<%= db_host %>',
7
- 'login' => '<%= db_login %>',
8
- 'password' => '<%= db_password %>',
9
- 'database' => '<%= db_name %>',
10
- 'prefix' => '<%= db_prefix %>',
11
- 'encoding' => '<%= db_encoding %>',
12
- );
13
- }
14
- ?>
2
+ /**
3
+ * The base configurations of the WordPress.
4
+ *
5
+ * This file has the following configurations: MySQL settings, Table Prefix,
6
+ * Secret Keys, WordPress Language, and ABSPATH. You can find more information
7
+ * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
8
+ * wp-config.php} Codex page. You can get the MySQL settings from your web host.
9
+ *
10
+ * This file is used by the wp-config.php creation script during the
11
+ * installation. You don't have to use the web site, you can just copy this file
12
+ * to "wp-config.php" and fill in the values.
13
+ *
14
+ * @package WordPress
15
+ */
16
+
17
+ // ** MySQL settings - You can get this info from your web host ** //
18
+ /** The name of the database for WordPress */
19
+ define('DB_NAME', '<%= db_name %>');
20
+
21
+ /** MySQL database username */
22
+ define('DB_USER', '<%= db_user %>');
23
+
24
+ /** MySQL database password */
25
+ define('DB_PASSWORD', '<%= db_password %>');
26
+
27
+ /** MySQL hostname */
28
+ define('DB_HOST', '<%= db_host %>');
29
+
30
+ /** Database Charset to use in creating database tables. */
31
+ define('DB_CHARSET', '<%= db_charset %>');
32
+
33
+ /** The Database Collate type. Don't change this if in doubt. */
34
+ define('DB_COLLATE', '<%= db_collate %>');
35
+
36
+ /**#@+
37
+ * Authentication Unique Keys and Salts.
38
+ *
39
+ * Change these to different unique phrases!
40
+ * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
41
+ * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
42
+ *
43
+ * @since 2.6.0
44
+ */
45
+ define('AUTH_KEY', '<%= key_auth %>');
46
+ define('SECURE_AUTH_KEY', '<%= key_secure %>');
47
+ define('LOGGED_IN_KEY', '<%= key_logged_in %>');
48
+ define('NONCE_KEY', '<%= key_nonce %>');
49
+ define('AUTH_SALT', '<%= key_salt %>');
50
+ define('SECURE_AUTH_SALT', '<%= key_salt_secure %>');
51
+ define('LOGGED_IN_SALT', '<%= key_salt_logged_in %>');
52
+ define('NONCE_SALT', '<%= key_salt_nonce %>');
53
+
54
+ /**#@-*/
55
+
56
+ /**
57
+ * WordPress Database Table prefix.
58
+ *
59
+ * You can have multiple installations in one database if you give each a unique
60
+ * prefix. Only numbers, letters, and underscores please!
61
+ */
62
+ $table_prefix = '<%= db_prefix %>';
63
+
64
+ /**
65
+ * WordPress Localized Language, defaults to English.
66
+ *
67
+ * Change this to localize WordPress. A corresponding MO file for the chosen
68
+ * language must be installed to wp-content/languages. For example, install
69
+ * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
70
+ * language support.
71
+ */
72
+ define ('WPLANG', '<%= lang %>');
73
+
74
+ /**
75
+ * For developers: WordPress debugging mode.
76
+ *
77
+ * Change this to true to enable the display of notices during development.
78
+ * It is strongly recommended that plugin and theme developers use WP_DEBUG
79
+ * in their development environments.
80
+ */
81
+ define('WP_DEBUG', <%= debug %>);
82
+
83
+ /* That's all, stop editing! Happy blogging. */
84
+
85
+ /** Absolute path to the WordPress directory. */
86
+ if ( !defined('ABSPATH') )
87
+ define('ABSPATH', dirname(__FILE__) . '/');
88
+
89
+ /** Sets up WordPress vars and included files. */
90
+ require_once(ABSPATH . 'wp-settings.php');
@@ -0,0 +1,90 @@
1
+ <?php
2
+ /**
3
+ * The base configurations of the WordPress.
4
+ *
5
+ * This file has the following configurations: MySQL settings, Table Prefix,
6
+ * Secret Keys, WordPress Language, and ABSPATH. You can find more information
7
+ * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
8
+ * wp-config.php} Codex page. You can get the MySQL settings from your web host.
9
+ *
10
+ * This file is used by the wp-config.php creation script during the
11
+ * installation. You don't have to use the web site, you can just copy this file
12
+ * to "wp-config.php" and fill in the values.
13
+ *
14
+ * @package WordPress
15
+ */
16
+
17
+ // ** MySQL settings - You can get this info from your web host ** //
18
+ /** The name of the database for WordPress */
19
+ define('DB_NAME', '<%= db_name %>');
20
+
21
+ /** MySQL database username */
22
+ define('DB_USER', '<%= db_user %>');
23
+
24
+ /** MySQL database password */
25
+ define('DB_PASSWORD', '<%= db_password %>');
26
+
27
+ /** MySQL hostname */
28
+ define('DB_HOST', '<%= db_host %>');
29
+
30
+ /** Database Charset to use in creating database tables. */
31
+ define('DB_CHARSET', '<%= db_charset %>');
32
+
33
+ /** The Database Collate type. Don't change this if in doubt. */
34
+ define('DB_COLLATE', '<%= db_collate %>');
35
+
36
+ /**#@+
37
+ * Authentication Unique Keys and Salts.
38
+ *
39
+ * Change these to different unique phrases!
40
+ * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
41
+ * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
42
+ *
43
+ * @since 2.6.0
44
+ */
45
+ define('AUTH_KEY', '<%= key_auth %>');
46
+ define('SECURE_AUTH_KEY', '<%= key_secure %>');
47
+ define('LOGGED_IN_KEY', '<%= key_logged_in %>');
48
+ define('NONCE_KEY', '<%= key_nonce %>');
49
+ define('AUTH_SALT', '<%= salt_auth %>');
50
+ define('SECURE_AUTH_SALT', '<%= salt_secure %>');
51
+ define('LOGGED_IN_SALT', '<%= salt_logged_in %>');
52
+ define('NONCE_SALT', '<%= salt_nonce %>');
53
+
54
+ /**#@-*/
55
+
56
+ /**
57
+ * WordPress Database Table prefix.
58
+ *
59
+ * You can have multiple installations in one database if you give each a unique
60
+ * prefix. Only numbers, letters, and underscores please!
61
+ */
62
+ $table_prefix = '<%= db_prefix %>';
63
+
64
+ /**
65
+ * WordPress Localized Language, defaults to English.
66
+ *
67
+ * Change this to localize WordPress. A corresponding MO file for the chosen
68
+ * language must be installed to wp-content/languages. For example, install
69
+ * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
70
+ * language support.
71
+ */
72
+ define ('WPLANG', '<%= wplang %>');
73
+
74
+ /**
75
+ * For developers: WordPress debugging mode.
76
+ *
77
+ * Change this to true to enable the display of notices during development.
78
+ * It is strongly recommended that plugin and theme developers use WP_DEBUG
79
+ * in their development environments.
80
+ */
81
+ define('WP_DEBUG', <%= wpdebug %>);
82
+
83
+ /* That's all, stop editing! Happy blogging. */
84
+
85
+ /** Absolute path to the WordPress directory. */
86
+ if ( !defined('ABSPATH') )
87
+ define('ABSPATH', dirname(__FILE__) . '/');
88
+
89
+ /** Sets up WordPress vars and included files. */
90
+ require_once(ABSPATH . 'wp-settings.php');
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cappress
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jad Bitar
@@ -47,6 +47,7 @@ files:
47
47
  - lib/templates/create_database.rsql
48
48
  - lib/templates/database.rphp
49
49
  - lib/templates/maintenance.rhtml
50
+ - lib/templates/wp-config.rphp
50
51
  - LICENSE
51
52
  - README.markdown
52
53
  has_rdoc: true