shuttle-deploy 0.2.0.beta3 → 0.2.0.beta4
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 +8 -8
- data/examples/wordpress.yml +3 -1
- data/lib/shuttle/deployment/wordpress/cli.rb +18 -7
- data/lib/shuttle/deployment/wordpress/core.rb +11 -5
- data/lib/shuttle/deployment/wordpress/vip.rb +5 -5
- data/lib/shuttle/deployment/wordpress.rb +19 -5
- data/lib/shuttle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTdhYWM4MjI3ZmUyZjE5Mzc4YTJjNjFjYjA2ODViZWE3YWVlZTllZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzUxMzk0ZDlhMGYyYWNjYmI2YjdkMmM5NzNkN2I2MmM5YWRjOTI2MQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzVkZTFlNzgxMGI1ZjNmMDQ5ZmVjYjRiNzVmNGYwMWU2NDBmYmJkNzllZDA4
|
10
|
+
ZTBhYmUwMjQ3YjZlOGEzMGMxODVmMWY2MzAwMjQ3NWU3NzU5ZjJiNjZiZTJi
|
11
|
+
ZjllNTIxYzBkN2I0NDJiODM1NGEzODI3NDM2NmNhZTBiZGQ2MmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmY3NGUwNDUyM2NkYWQ1ZjkwMWQ4ZjIyOWFjMWFkMDFmYmQ4OTU0ZTZkMzAy
|
14
|
+
YzVmNTdmYTA4MDVkYmYzNzhkZDJmY2QxZWFmMjgwYjM1OTNhNGJkZmJkODcz
|
15
|
+
ZTIyM2Y2ZTAyODBhNWI0MDgyZmRlMTRmY2M0YTlmNWY4YTg2MDM=
|
data/examples/wordpress.yml
CHANGED
@@ -11,6 +11,8 @@ target:
|
|
11
11
|
deploy_to: /home/deployer/www
|
12
12
|
|
13
13
|
wordpress:
|
14
|
+
core: 3.5.1
|
15
|
+
cli: 0.9.1
|
14
16
|
theme: theme_name
|
15
17
|
site:
|
16
18
|
title: "Site Title"
|
@@ -31,4 +33,4 @@ wordpress:
|
|
31
33
|
- featured-page-widget
|
32
34
|
- share-this
|
33
35
|
- twitter-widget-pro
|
34
|
-
- types
|
36
|
+
- types
|
@@ -3,25 +3,36 @@ module Shuttle
|
|
3
3
|
CLI_GIT = 'https://github.com/wp-cli/wp-cli.git'
|
4
4
|
CLI_PATH = '/usr/local/share/wp-cli'
|
5
5
|
|
6
|
-
# Check if CLI is installed
|
7
|
-
# @return [Boolean]
|
8
6
|
def cli_installed?
|
9
7
|
ssh.run("which wp").success?
|
10
8
|
end
|
11
9
|
|
12
|
-
# Install wordpress CLI
|
13
|
-
# @return [Boolean]
|
14
10
|
def cli_install
|
15
|
-
log "Installing
|
11
|
+
log "Installing WordPress CLI"
|
16
12
|
|
17
13
|
ssh.run("sudo git clone --recursive --quiet #{CLI_GIT} #{CLI_PATH}")
|
14
|
+
|
15
|
+
if config.wordpress.cli.nil?
|
16
|
+
tags = ssh.capture("cd #{CLI_PATH} && git tag").split("\n").map(&:strip).reverse
|
17
|
+
tag = tags.first
|
18
|
+
rev = ssh.capture("cd #{CLI_PATH} && git rev-parse #{tag}").strip
|
19
|
+
else
|
20
|
+
tag = rev = config.wordpress.cli
|
21
|
+
end
|
22
|
+
|
23
|
+
ssh.run("cd #{CLI_PATH} && sudo git checkout #{rev}")
|
18
24
|
ssh.run("cd #{CLI_PATH} && sudo utils/dev-build")
|
19
25
|
|
20
26
|
if cli_installed?
|
21
|
-
log "
|
27
|
+
log "WordPress CLI (#{tag}) installed"
|
22
28
|
else
|
23
|
-
error "Unable to install
|
29
|
+
error "Unable to install WordPress CLI"
|
24
30
|
end
|
25
31
|
end
|
32
|
+
|
33
|
+
def cli_uninstall
|
34
|
+
ssh.run("sudo rm $(which wp)")
|
35
|
+
ssh.run("sudo rm -rf #{CLI_PATH}")
|
36
|
+
end
|
26
37
|
end
|
27
38
|
end
|
@@ -21,18 +21,24 @@ module Shuttle
|
|
21
21
|
core_remove
|
22
22
|
end
|
23
23
|
|
24
|
-
log "Installing
|
24
|
+
log "Installing WordPress core"
|
25
25
|
|
26
26
|
unless ssh.directory_exists?(core_path)
|
27
27
|
ssh.run("mkdir -p #{core_path}")
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
cmd = "cd #{core_path} && wp core download"
|
31
|
+
|
32
|
+
if config.wordpress.core
|
33
|
+
cmd << " --version=#{config.wordpress.core}"
|
34
|
+
end
|
35
|
+
|
36
|
+
result = ssh.run(cmd)
|
31
37
|
|
32
38
|
if result.success?
|
33
|
-
log "
|
39
|
+
log "WordPress core installed"
|
34
40
|
else
|
35
|
-
error "Unable to install
|
41
|
+
error "Unable to install WordPress core: #{result.output}"
|
36
42
|
end
|
37
43
|
end
|
38
44
|
|
@@ -40,7 +46,7 @@ module Shuttle
|
|
40
46
|
# @return [Boolean]
|
41
47
|
def core_remove
|
42
48
|
if ssh.directory_exists?(core_path)
|
43
|
-
log "Removing
|
49
|
+
log "Removing WordPress shared core"
|
44
50
|
ssh.run("rm -rf #{core_path}")
|
45
51
|
end
|
46
52
|
|
@@ -30,7 +30,7 @@ module Shuttle
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def vip_install
|
33
|
-
log "Installing
|
33
|
+
log "Installing WordPress VIP"
|
34
34
|
|
35
35
|
vip = vip_get_config
|
36
36
|
|
@@ -47,9 +47,9 @@ module Shuttle
|
|
47
47
|
res = ssh.run(cmd, &method(:stream_output))
|
48
48
|
|
49
49
|
if res.success?
|
50
|
-
log "
|
50
|
+
log "WordPress VIP installed"
|
51
51
|
else
|
52
|
-
raise DeployError, "Unable to install
|
52
|
+
raise DeployError, "Unable to install WordPress VIP. Reason: #{res.output}"
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -73,9 +73,9 @@ module Shuttle
|
|
73
73
|
def vip_link
|
74
74
|
ssh.run("mkdir -p #{release_path}/wp-content/themes/vip")
|
75
75
|
result = ssh.run("cp -a #{vip_path} #{release_path('wp-content/themes/vip/plugins')}")
|
76
|
-
|
76
|
+
|
77
77
|
if result.success?
|
78
|
-
log "
|
78
|
+
log "WordPress VIP is linked"
|
79
79
|
else
|
80
80
|
error "Unable to link VIP: #{result.output}"
|
81
81
|
end
|
@@ -19,8 +19,22 @@ module Shuttle
|
|
19
19
|
|
20
20
|
setup_shared_dirs
|
21
21
|
check_dependencies
|
22
|
-
|
23
|
-
|
22
|
+
|
23
|
+
if !cli_installed?
|
24
|
+
cli_install
|
25
|
+
else
|
26
|
+
version = ssh.capture("cd #{core_path} && wp --version")
|
27
|
+
version.gsub!('wp-cli', '').strip!
|
28
|
+
log "WordPress CLI version: #{version}"
|
29
|
+
end
|
30
|
+
|
31
|
+
if !core_installed?
|
32
|
+
core_install
|
33
|
+
else
|
34
|
+
version = ssh.capture("cd #{core_path} && wp core version")
|
35
|
+
log "WordPress core version: #{version}"
|
36
|
+
end
|
37
|
+
|
24
38
|
check_config
|
25
39
|
end
|
26
40
|
|
@@ -87,13 +101,13 @@ module Shuttle
|
|
87
101
|
if res.success?
|
88
102
|
log "A new wordpress config has been generated"
|
89
103
|
else
|
90
|
-
error "Unable to generate config"
|
104
|
+
error "Unable to generate config. Error: #{res.output}"
|
91
105
|
end
|
92
106
|
end
|
93
107
|
|
94
108
|
def check_config
|
95
|
-
if !ssh.file_exists?(shared_path('wp-config.php'))
|
96
|
-
log "Creating wordpress config
|
109
|
+
if !ssh.file_exists?(shared_path('wordpress/core/wp-config.php'))
|
110
|
+
log "Creating wordpress config"
|
97
111
|
generate_config
|
98
112
|
end
|
99
113
|
end
|
data/lib/shuttle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shuttle-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|