railman-deployment 0.1.1 → 0.1.2
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 +4 -4
- data/lib/railman/tasks/deployment.rake +30 -16
- data/lib/railman-deployment/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40e3b30b4d73cdfc5e63f422b0f544820434a446
|
4
|
+
data.tar.gz: c170612a2484d2bb995f774d83110ad611c11737
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e12a1080d3fa54b555b6a0c81e5688ea03fa7e6921ea1ac1e1bc50b3c49586613c78b8527e58c0b46b49a15f573623e6e6169bee586d8cb33d046b0bffdfa17
|
7
|
+
data.tar.gz: 8482f771f76472bd3d23d3947164f7340ab94eace207ca3c80a21f94eba8dd542a8ec8f9f1edc6299bdcd6779e102037eb8de1fdaf6d3c836ee94ac3dc0a1dd4
|
@@ -3,10 +3,8 @@ task :setup do
|
|
3
3
|
on roles(:all) do
|
4
4
|
with fetch(:environment) do
|
5
5
|
if test "[ -d #{fetch(:deploy_to)} ]"
|
6
|
-
|
7
|
-
|
8
|
-
invoke :sync_local_dirs_to_server
|
9
|
-
end
|
6
|
+
invoke :fetch_and_reset_git_repository
|
7
|
+
invoke :sync_local_dirs_to_server
|
10
8
|
else
|
11
9
|
execute :git, :clone, fetch(:repo_url), fetch(:deploy_to)
|
12
10
|
end
|
@@ -103,30 +101,46 @@ task :reset_server do
|
|
103
101
|
end
|
104
102
|
|
105
103
|
task :sync_local_dirs_to_server do
|
106
|
-
|
107
|
-
|
108
|
-
|
104
|
+
on roles(:all) do
|
105
|
+
fetch(:sync_dirs, []).each do |sync_dir|
|
106
|
+
run_locally do
|
107
|
+
execute "rsync -avz --delete -e ssh ./#{sync_dir}/ #{fetch(:user)}@#{fetch(:server)}:#{fetch(:deploy_to)}/#{sync_dir}/"
|
108
|
+
end
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
113
|
task :sync_local_dirs_from_server do
|
114
|
-
|
115
|
-
|
116
|
-
|
114
|
+
on roles(:all) do
|
115
|
+
fetch(:sync_dirs, []).each do |sync_dir|
|
116
|
+
run_locally do
|
117
|
+
execute "rsync -avzm --delete --force -e ssh #{fetch(:user)}@#{fetch(:server)}:#{fetch(:deploy_to)}/#{sync_dir}/ ./#{sync_dir}/"
|
118
|
+
end
|
117
119
|
end
|
118
120
|
end
|
119
121
|
end
|
120
122
|
|
121
123
|
task :fetch_and_reset_git_repository do
|
122
|
-
|
123
|
-
|
124
|
+
on roles(:all) do
|
125
|
+
with fetch(:environment) do
|
126
|
+
within fetch(:deploy_to) do
|
127
|
+
execute :git, :fetch, 'origin'
|
128
|
+
execute :git, :reset, "--hard origin/#{fetch(:deploy_branch, 'master')}"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
124
132
|
end
|
125
133
|
|
126
134
|
task :create_database_from_sql_file do
|
127
|
-
|
128
|
-
|
129
|
-
|
135
|
+
on roles(:all) do
|
136
|
+
with fetch(:environment) do
|
137
|
+
within fetch(:deploy_to) do
|
138
|
+
execute :rake, 'db:create'
|
139
|
+
if test "[ -f #{fetch(:deploy_to)}/db/#{fetch(:application)}.sql ]"
|
140
|
+
execute :psql, "-d #{fetch(:application)}_production", "-f db/#{fetch(:application)}.sql"
|
141
|
+
end
|
142
|
+
execute :rake, 'db:migrate'
|
143
|
+
end
|
144
|
+
end
|
130
145
|
end
|
131
|
-
execute :rake, 'db:migrate'
|
132
146
|
end
|