pave 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dca6ce62e803a633172e15f128a10c1db7ddb46e
4
- data.tar.gz: 6abf652c95be62aa92e2229c31299376a76c6aa1
3
+ metadata.gz: 51010f11d688daf56a02e4d565813dcec29436dc
4
+ data.tar.gz: a2e67566e859660b1f2ad07c0748ed6075b200ce
5
5
  SHA512:
6
- metadata.gz: 99e429cd2172c75461de4812b0f614a29597d0d34b02c733a057877c5010e59e8b73a9b8e21f2d7d2515d906381068af99bd6fb4cbbc3ea017aa8531b6dae74b
7
- data.tar.gz: 73b1a73e6e88ec5f22b81c16478a3b8b90ba98bed9d79cbc9119fbdb2e3183b42511d7e5f3bb370fa0e5b0a80dd32933fe12cf6f0c3828eb38bb7cddfc1356d1
6
+ metadata.gz: a0dee91466eb5f6092fcf3c7be14e66791ad505628a364ebabbeb214b8333e6d484d9f8db107c135a7de6e0ff16fa2a24bf7659b84209ebf7c07053c389b441b
7
+ data.tar.gz: 0d3cc447999ccb062a9b87d237c58e060f896d53e0c215d641ff43bf9dd997bba83d297e5f7739f4ba088d683327f4146f05e8b14b190c7539c54f508efcd8b3
data/README.md CHANGED
@@ -10,7 +10,7 @@ Provides a set of command line tools for Concrete5.
10
10
 
11
11
  ## Usage
12
12
 
13
- Create a new Concrete5 website:
13
+ #### Create a new Concrete5 website:
14
14
 
15
15
  $ pave new mywebsite
16
16
 
@@ -22,21 +22,30 @@ This:
22
22
  4. Builds an app folder of commonly used folders (symlinked into the root folder so Concrete5 can find them)
23
23
  5. Initializes a Git repo and adds the first ("Initial") commit.
24
24
 
25
- Other commands:
25
+ #### Deployments
26
26
 
27
- $ pave --help
28
-
29
- Outputs common tasks that pave can do.
27
+ $ pave deploy:setup
28
+
29
+ This sets up a deployment script to the remote server and deploys an initial version.
30
+
31
+ $ pave deploy
32
+
33
+ Deploys the site using git.
30
34
 
31
- ## TODO
35
+ #### Database
32
36
 
33
- 1. ? Create database (`pave database mydatabase`)
34
- 1. Tell user to go set up Concrete5 in-browser once virtual host and db is set up
35
- 1. Uninstall? `pave remove mywebsite` (including virtual host)
36
- 1. Do database dumps. `pave db dump`
37
- 1. Do live database download & replace local one. `pave db download` (confirmation first)
38
- 1. Do local database upload & replace remote one. `pave db upload` (confirmation first)
37
+ TODO:
39
38
 
39
+ $ pave db:create
40
+ $ pave db:push
41
+ $ pave db:pull
42
+ $ pave db:backup
43
+
44
+ #### Help
45
+
46
+ $ pave --help
47
+
48
+ Outputs common tasks that pave can do.
40
49
 
41
50
  ## Contributing
42
51
 
data/bin/pave CHANGED
@@ -146,3 +146,21 @@ command :"db:upload" do |c|
146
146
  say "`db:upload` command not implemented yet."
147
147
  end
148
148
  end
149
+
150
+ command :"deploy" do |c|
151
+ c.syntax = "pave deploy"
152
+ c.description = "Deploy project to web server."
153
+ c.action do |args|
154
+ remote = args[0] || "production"
155
+ branch = args[1] || "master"
156
+ Pave::Deploy.new.deploy(remote, branch)
157
+ end
158
+ end
159
+
160
+ command :"deploy:setup" do |c|
161
+ c.syntax = "pave deploy:setup"
162
+ c.description = "Setup deployment via git to web server."
163
+ c.action do
164
+ Pave::Deploy.new.setup
165
+ end
166
+ end
data/lib/pave/concrete.rb CHANGED
@@ -47,7 +47,6 @@ module Pave
47
47
  gitkeep_folders.each{ |folder| sh "touch #{name}/#{folder}/.keep" }
48
48
  sh "touch #{name}/files/.keep"
49
49
  sh "touch #{name}/updates/.keep"
50
- # sh "cd #{name} && git init && git add -A && git commit -m 'Initial'"
51
50
  end
52
51
 
53
52
  def gitignored_folders
data/lib/pave/database.rb CHANGED
@@ -1,5 +1,3 @@
1
- require "pave/shell"
2
-
3
1
  module Pave
4
2
  class Database
5
3
  include Pave::Shell
@@ -0,0 +1,25 @@
1
+ module Pave
2
+ class Deploy
3
+ include Pave::Shell
4
+
5
+ def setup
6
+ server = ask "Username and hostname of the remote server (e.g. user@server.com): "
7
+ folder = ask "Name of the remote directory (e.g. ~/webapps/appname/): "
8
+ remote = ask "Desired git remote name (e.g. production): "
9
+ script = File.join(File.expand_path("../..", File.dirname(__FILE__)), "resources/deploy.sh")
10
+
11
+ puts "Piping shell script to #{server} for setup."
12
+ sh "ssh #{server} 'cd #{folder}; bash -s' < #{script}"
13
+
14
+ sh "git remote remove #{remote}"
15
+ sh "git remote add #{remote} #{server}:#{folder}/deploy.git"
16
+
17
+ puts "Finished! You may now run `pave deploy` to deploy your application."
18
+ end
19
+
20
+ def deploy(remote="production", branch="master")
21
+ sh "git push #{remote} #{branch}"
22
+ end
23
+ end
24
+ end
25
+
data/lib/pave/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pave
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -1,4 +1,3 @@
1
- require "pave/shell"
2
1
  require "fileutils"
3
2
 
4
3
  module Pave
data/lib/pave.rb CHANGED
@@ -4,6 +4,7 @@ require "pave/shell"
4
4
  require "pave/concrete"
5
5
  require "pave/database"
6
6
  require "pave/virtual_host"
7
+ require "pave/deploy"
7
8
 
8
9
  module Pave
9
10
  def update
@@ -0,0 +1,8 @@
1
+ #!bin/bash
2
+ if [ ! -d 'deploy.git' ]; then
3
+ mkdir deploy.git && cd deploy.git
4
+ git init --bare
5
+ echo '#!/bin/sh' > hooks/post-receive
6
+ echo 'GIT_WORK_TREE=.. git checkout -f' >> hooks/post-receive
7
+ chmod +x hooks/post-receive
8
+ fi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamon Holmgren
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-04 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -101,10 +101,12 @@ files:
101
101
  - lib/pave.rb
102
102
  - lib/pave/concrete.rb
103
103
  - lib/pave/database.rb
104
+ - lib/pave/deploy.rb
104
105
  - lib/pave/shell.rb
105
106
  - lib/pave/version.rb
106
107
  - lib/pave/virtual_host.rb
107
108
  - pave.gemspec
109
+ - resources/deploy.sh
108
110
  - test/pave_test.rb
109
111
  homepage: https://github.com/jamonholmgren/pave
110
112
  licenses: