alphonse 0.0.4 → 0.0.5
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/README.md +53 -3
- data/lib/alphonse/default/fonzfile.rb +3 -1
- data/lib/alphonse/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: 0e62eb740aaa3582c44b98cb88081880d2b62d09
|
4
|
+
data.tar.gz: 30ca2e601d5c3cfcc8d70570558cd8608c89c6a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ea7cf8ed79c288d48442bc4e60f3175fb0b770959912c4ce1349dfc6a1e4aa9fe199fe6f9d893bd40e6b389aea7af88bc488f299de3d31434156083b1a47ad9
|
7
|
+
data.tar.gz: e406f25c7c356fbd597df5a4530b0f5962b0c95cede53c816032b905a27cef93973f2b3f89c0eeb28a9c7253d34a793e3ceac42338ffcfee5a4554cd9f047bb9
|
data/README.md
CHANGED
@@ -1,20 +1,70 @@
|
|
1
1
|
# Alphonse
|
2
2
|
|
3
|
-
|
3
|
+
Deploy like the fonz with this simple deployment gem.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
+
1. Either `gem install alphonse` or add it to your Gemfile `gem "alphonse", "~> 0.0.4"`.
|
8
|
+
2. Navigate to the directory in which you wish to use alphonse.
|
9
|
+
3. Run `alphonse init` - this will generate the default Fonzfile.
|
10
|
+
4. Edit the Fonzfile to suit your app and deployment operations required.
|
7
11
|
|
8
12
|
## Usage
|
9
13
|
|
10
|
-
|
14
|
+
Once you have finished optmising the Fonzfile with the specific operations configurations, run the operations using `alphonse [OPERATION] [OPTIONS]`:
|
11
15
|
|
16
|
+
`alphonse setup`
|
17
|
+
`alphonse deploy -e staging` (the environment will be used when running rake tasks)
|
18
|
+
`alphonse update --verbose` (verbose will return the output of each command irrelevant of success or failure)
|
19
|
+
|
20
|
+
### Task
|
21
|
+
|
22
|
+
A Task is a set of simple commands that are to be run in sequence. For example, the preset :clone_repository action consists of the following commands used to clone a git repository:
|
23
|
+
|
24
|
+
`"git checkout master -q", "git pull origin master -q", "git gc --aggressive"`
|
25
|
+
|
26
|
+
### Operation
|
27
|
+
|
28
|
+
An Operation is in turn a collection of Tasks which are run in sequence. For example, the present :deploy operation consists of the following Tasks which could be considered necessary for a Rails app deployment
|
29
|
+
|
30
|
+
```ruby :install_gems, :setup_database, :restart_app```
|
31
|
+
|
32
|
+
### Example Fonzfile
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
# Settings
|
36
|
+
user 'remote_user'
|
37
|
+
app_name 'application_name'
|
38
|
+
hosts 'stage.example.com'
|
39
|
+
path "/fullpath/to/folder"
|
40
|
+
git_repo 'git@gitaddress:application_name.git'
|
41
|
+
branch 'master'
|
42
|
+
ruby_bin_path '/path/to/ruby/'
|
43
|
+
start_command 'start_app command'
|
44
|
+
restart_command 'restart_app command' # E.g. 'touch tmp/restart.txt'
|
45
|
+
|
46
|
+
operation :setup, 'Setup server' do
|
47
|
+
tasks :setup_directory
|
48
|
+
end
|
49
|
+
|
50
|
+
operation :deploy, 'Deploy repository' do
|
51
|
+
tasks :clone_repository, :install_gems, :setup_database, :start_app
|
52
|
+
end
|
53
|
+
|
54
|
+
operation :update, 'Update the repository on the server' do
|
55
|
+
tasks :update_repository, :install_gems, :update_database, :restart_app
|
56
|
+
end
|
57
|
+
|
58
|
+
operation :restart, 'Restart application' do
|
59
|
+
tasks :restart_app
|
60
|
+
end
|
61
|
+
```
|
12
62
|
|
13
63
|
## Note
|
14
64
|
|
15
65
|
Chances are you will experience issues with PATH variables and rubygems etc. So here's a quick solution:
|
16
66
|
|
17
|
-
Log in to your
|
67
|
+
Log in to your server, as a root user, add the following line to /etc/ssh/sshd_config:
|
18
68
|
|
19
69
|
PermitUserEnvironment yes
|
20
70
|
|
@@ -6,13 +6,14 @@ path "/fullpath/to/folder"
|
|
6
6
|
git_repo 'git@gitaddress:repository.git'
|
7
7
|
branch 'master'
|
8
8
|
ruby_bin_path '/path/to/ruby/'
|
9
|
+
restart_command 'touch tmp/restart.txt'
|
9
10
|
|
10
11
|
operation :setup, 'Setup server' do
|
11
12
|
tasks :setup_directory
|
12
13
|
end
|
13
14
|
|
14
15
|
operation :deploy, 'Deploy repository' do
|
15
|
-
tasks :clone_repository, :install_gems, :setup_database, :
|
16
|
+
tasks :clone_repository, :install_gems, :setup_database, :start_app
|
16
17
|
end
|
17
18
|
|
18
19
|
operation :update, 'Update the repository on the server' do
|
@@ -31,4 +32,5 @@ end
|
|
31
32
|
# install_gems
|
32
33
|
# setup_database
|
33
34
|
# update_database
|
35
|
+
# start_app
|
34
36
|
# restart_app
|
data/lib/alphonse/version.rb
CHANGED