mina-laravel 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +94 -0
- data/lib/mina-laravel.rb +99 -0
- data/mina-laravel.gemspec +18 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 89a93ab6da497e59a68a7c1b11f97639d56b3c22
|
4
|
+
data.tar.gz: 6f87314e4956716c44e169036080b8cc58da83e8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b0ad402f8f64b41b4576ae9212a90cb7f220f6cb1e12f9c41e6c48efd10d35555840bde7ba40e395c07f91ae15c518f8736a37f1eb0170d93dc5451624e1ba3e
|
7
|
+
data.tar.gz: 4144f442475f7e1fd60dbcc46549df3a800f432c8c5ea11a3c79b42a44652d2bbed0f2cabbaff3403376afd5c5a072286fac9964fbd1a3f54e1ad565952b7e1a
|
data/README.md
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# mina-laravel
|
2
|
+
|
3
|
+
mina-laravel is a gem that adds many tasks to aid in the deployment of [laravel] (http://laravel.com) applications
|
4
|
+
using [Mina] (http://nadarei.co/mina).
|
5
|
+
|
6
|
+
# Getting Start
|
7
|
+
|
8
|
+
## Instalation
|
9
|
+
|
10
|
+
gem install mina-laravel
|
11
|
+
|
12
|
+
## Configuration
|
13
|
+
|
14
|
+
After installation, create a file in the root directory of your project called `Minafile`.
|
15
|
+
|
16
|
+
Note: Mina uses the command `mina init` to create a config file at `config/deploy.rb`, but laravel use the `Config` directory to hold configurations.
|
17
|
+
To avoid problems we recommend using `Minafile` instead of `config/deploy.rb`
|
18
|
+
|
19
|
+
`Minafile` sample:
|
20
|
+
```ruby
|
21
|
+
require 'mina/git'
|
22
|
+
require 'mina-laravel'
|
23
|
+
# Basic settings:
|
24
|
+
# domain - The hostname to SSH to.
|
25
|
+
# deploy_to - Path to deploy into.
|
26
|
+
# repository - Git repo to clone from. (needed by mina/git)
|
27
|
+
# branch - Branch name to deploy. (needed by mina/git)
|
28
|
+
|
29
|
+
set :user, 'deploy'
|
30
|
+
set :domain, 'antesky.com'
|
31
|
+
set :deploy_to, '/home/deploy/www/App'
|
32
|
+
set :repository, 'git@git.coding.net:someone/App.git'
|
33
|
+
set :branch, 'master'
|
34
|
+
|
35
|
+
set :shared_paths, ['.env', 'storage', 'vendor', 'node_modules', 'public/uploads']
|
36
|
+
|
37
|
+
desc "Deploys the current version to the server."
|
38
|
+
task :deploy => :environment do
|
39
|
+
deploy do
|
40
|
+
invoke :'git:clone'
|
41
|
+
invoke :'deploy:link_shared_paths'
|
42
|
+
|
43
|
+
queue 'composer install'
|
44
|
+
queue 'php artisan migrate --force'
|
45
|
+
|
46
|
+
invoke :'laravel:build_assets'
|
47
|
+
|
48
|
+
invoke :'deploy:cleanup'
|
49
|
+
to :launch do
|
50
|
+
queue 'composer dumpautoload'
|
51
|
+
queue 'php artisan optimize'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
## Setup Environment
|
59
|
+
|
60
|
+
mina setup
|
61
|
+
|
62
|
+
More at http://nadarei.co/mina/directory_structure.html
|
63
|
+
|
64
|
+
## Deploying
|
65
|
+
|
66
|
+
mina deploy
|
67
|
+
|
68
|
+
More at http://nadarei.co/mina/deploying.html
|
69
|
+
|
70
|
+
## Tail log from server
|
71
|
+
|
72
|
+
mina log
|
73
|
+
|
74
|
+
## More tasks
|
75
|
+
|
76
|
+
Run
|
77
|
+
|
78
|
+
mina -T
|
79
|
+
|
80
|
+
To list all tasks.
|
81
|
+
|
82
|
+
## Contributing to mina-laravel
|
83
|
+
|
84
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
85
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
86
|
+
* Fork the project.
|
87
|
+
* Start a feature/bugfix branch.
|
88
|
+
* Commit and push until you are happy with your contribution.
|
89
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
90
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
91
|
+
|
92
|
+
## Copyright
|
93
|
+
|
94
|
+
Copyright (c) 2015 kikyous.
|
data/lib/mina-laravel.rb
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# ### asset_paths
|
2
|
+
# The paths to be checked.
|
3
|
+
#
|
4
|
+
# Whenever assets are compiled, the asset files are checked if they have
|
5
|
+
# changed from the previous release.
|
6
|
+
#
|
7
|
+
# If they're unchanged, compiled assets will simply be copied over to the new
|
8
|
+
# release.
|
9
|
+
#
|
10
|
+
# Override this if you have custom asset paths
|
11
|
+
|
12
|
+
set_default :asset_paths, ['resources/assets/']
|
13
|
+
|
14
|
+
# ### compiled_asset_path
|
15
|
+
# The path to be copied to the new release.
|
16
|
+
#
|
17
|
+
# The path your assets are compiled to. If your `assets_path` assets have changed,
|
18
|
+
# this is the folder that gets copied accross from the current release to the new release.
|
19
|
+
#
|
20
|
+
# Override this if you have custom public asset paths.
|
21
|
+
|
22
|
+
set_default :compiled_asset_path, 'public/build'
|
23
|
+
|
24
|
+
# ### rake_assets_precompile
|
25
|
+
# The command to invoke when precompiling assets.
|
26
|
+
# Override me if you like.
|
27
|
+
|
28
|
+
settings.cmd_assets_build ||= lambda { 'gulp --production' }
|
29
|
+
|
30
|
+
def check_for_changes_script(options={})
|
31
|
+
diffs = options[:at].map { |path|
|
32
|
+
%[diff -rN "#{deploy_to}/#{current_path}/#{path}" "./#{path}" 2>/dev/null]
|
33
|
+
}.join("\n")
|
34
|
+
|
35
|
+
unindent %[
|
36
|
+
if [ -e "#{deploy_to}/#{current_path}/#{options[:check]}" ]; then
|
37
|
+
count=`(
|
38
|
+
#{reindent 4, diffs}
|
39
|
+
) | wc -l`
|
40
|
+
if [ "$((count))" = "0" ]; then
|
41
|
+
#{reindent 4, options[:skip]} &&
|
42
|
+
exit
|
43
|
+
else
|
44
|
+
#{reindent 4, options[:changed]}
|
45
|
+
fi
|
46
|
+
else
|
47
|
+
#{reindent 2, options[:default]}
|
48
|
+
fi
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
# ### log
|
53
|
+
# Tail log from server
|
54
|
+
#
|
55
|
+
# $ mina log
|
56
|
+
|
57
|
+
desc "Tail log from server"
|
58
|
+
task :log => :environment do
|
59
|
+
queue %[tail -f #{deploy_to}/#{current_path}/storage/logs/laravel.log]
|
60
|
+
end
|
61
|
+
|
62
|
+
namespace :laravel do
|
63
|
+
# ### gulp --production
|
64
|
+
desc "build assets (skips if nothing has changed since the last release)."
|
65
|
+
task :'build_assets' do
|
66
|
+
if ENV['force_assets']
|
67
|
+
invoke :'laravel:build_assets:force'
|
68
|
+
else
|
69
|
+
message = verbose_mode? ?
|
70
|
+
'$((count)) changes found, building asset files' :
|
71
|
+
'Building asset files'
|
72
|
+
|
73
|
+
queue check_for_changes_script \
|
74
|
+
:check => compiled_asset_path,
|
75
|
+
:at => [*asset_paths],
|
76
|
+
:skip => %[
|
77
|
+
echo "-----> Skipping build asset"
|
78
|
+
#{echo_cmd %[mkdir -p "#{deploy_to}/$build_path/#{compiled_asset_path}"]}
|
79
|
+
#{echo_cmd %[cp -R "#{deploy_to}/#{current_path}/#{compiled_asset_path}/." "#{deploy_to}/$build_path/#{compiled_asset_path}"]}
|
80
|
+
],
|
81
|
+
:changed => %[
|
82
|
+
echo "-----> #{message}"
|
83
|
+
#{echo_cmd %[#{cmd_assets_build}]}
|
84
|
+
],
|
85
|
+
:default => %[
|
86
|
+
echo "-----> Building asset files"
|
87
|
+
#{echo_cmd %[#{cmd_assets_build}]}
|
88
|
+
]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
# ### laravel:build_assets:force
|
92
|
+
desc "Build assets."
|
93
|
+
task :'build_assets:force' do
|
94
|
+
queue %{
|
95
|
+
echo "-----> Building asset files"
|
96
|
+
#{echo_cmd %[#{cmd_assets_build}]}
|
97
|
+
}
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "mina-laravel"
|
5
|
+
s.version = '0.1'
|
6
|
+
s.authors = ["Kikyous"]
|
7
|
+
s.email = ["kikyous@163.com"]
|
8
|
+
s.homepage = "http://github.com/kikyous/mina-laravel"
|
9
|
+
s.summary = "Tools to deploy Laravel apps with mina."
|
10
|
+
s.description = "Tools to deploy Laravel apps with mina."
|
11
|
+
|
12
|
+
s.files = `git ls-files`.split("\n")
|
13
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
15
|
+
s.require_paths = ["lib"]
|
16
|
+
|
17
|
+
s.add_runtime_dependency "mina"
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-laravel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kikyous
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mina
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Tools to deploy Laravel apps with mina.
|
28
|
+
email:
|
29
|
+
- kikyous@163.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- README.md
|
35
|
+
- lib/mina-laravel.rb
|
36
|
+
- mina-laravel.gemspec
|
37
|
+
homepage: http://github.com/kikyous/mina-laravel
|
38
|
+
licenses: []
|
39
|
+
metadata: {}
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
requirements: []
|
55
|
+
rubyforge_project:
|
56
|
+
rubygems_version: 2.4.5
|
57
|
+
signing_key:
|
58
|
+
specification_version: 4
|
59
|
+
summary: Tools to deploy Laravel apps with mina.
|
60
|
+
test_files: []
|