nanoc-scp 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +36 -0
- data/LICENSE +21 -0
- data/README.md +47 -0
- data/lib/nanoc/extra/deployers.rb +6 -0
- data/lib/nanoc/extra/deployers/scp.rb +38 -0
- data/lib/nanoc_scp.rb +1 -0
- data/nanoc-scp.gemspec +15 -0
- metadata +64 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1f6f12f6cdcbe55cd01df87e1b6e3846fa2824d1
|
4
|
+
data.tar.gz: b42d50f37c9db144f2589af60417baa7ae772c56
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f15591dd9e2ad02a361fffd49af8032db2335b60b66fb3ac10d979d08f6cc3272958d72daa87409d898ef0ddccbe0b277e0e8d64620efb928a500268ef9cecf3
|
7
|
+
data.tar.gz: d8040b7b82c6923dde5468a2c73b3c77009eba209549ce40779eefcd5e42cefa18c4957f0a90d0ad13c124f655399c2680d6c23b9467d59cb844149373b9a6c9
|
data/.gitignore
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
## Specific to RubyMotion:
|
14
|
+
.dat*
|
15
|
+
.repl_history
|
16
|
+
build/
|
17
|
+
|
18
|
+
## Documentation cache and generated files:
|
19
|
+
/.yardoc/
|
20
|
+
/_yardoc/
|
21
|
+
/doc/
|
22
|
+
/rdoc/
|
23
|
+
|
24
|
+
## Environment normalization:
|
25
|
+
/.bundle/
|
26
|
+
/vendor/bundle
|
27
|
+
/lib/bundler/man/
|
28
|
+
|
29
|
+
# for a library or gem, you might want to ignore these files since the code is
|
30
|
+
# intended to run in multiple environments; otherwise, check them in:
|
31
|
+
# Gemfile.lock
|
32
|
+
# .ruby-version
|
33
|
+
# .ruby-gemset
|
34
|
+
|
35
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
36
|
+
.rvmrc
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Mikhail Petrov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
nanoc-scp
|
2
|
+
===========
|
3
|
+
|
4
|
+
Very simple deploy script for [nanoc](http://nanoc.ws), that uses only scp.
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```bash
|
12
|
+
gem 'nanoc-scp'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then run:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Or install it yourself with:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
gem install nanoc-scp
|
25
|
+
```
|
26
|
+
|
27
|
+
Usage
|
28
|
+
-----
|
29
|
+
|
30
|
+
Put to your nanoc config something like this
|
31
|
+
|
32
|
+
```yaml
|
33
|
+
deploy:
|
34
|
+
default:
|
35
|
+
kind: scp
|
36
|
+
dst: "yourname@sftp.domain.org:/public_html"
|
37
|
+
options:
|
38
|
+
- "-i ~/.ssh/aws.pem"
|
39
|
+
```
|
40
|
+
|
41
|
+
and run
|
42
|
+
|
43
|
+
```
|
44
|
+
nanoc deploy
|
45
|
+
```
|
46
|
+
|
47
|
+
Enjoy!
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Nanoc::Extra::Deployers
|
2
|
+
# Very simple nanoc plugin for deploy via scp.
|
3
|
+
#
|
4
|
+
# @example A deployment configuration
|
5
|
+
#
|
6
|
+
# deploy:
|
7
|
+
# default:
|
8
|
+
# kind: scp
|
9
|
+
# dst: "yourname@sftp.domain.org:/public_html"
|
10
|
+
#
|
11
|
+
|
12
|
+
class Scp < ::Nanoc::Extra::Deployer
|
13
|
+
DEFAULT_OPTIONS = %w(-2 -r).freeze
|
14
|
+
|
15
|
+
def run
|
16
|
+
src = source_path + '/'
|
17
|
+
dst = config[:dst]
|
18
|
+
options = config[:options] || DEFAULT_OPTIONS
|
19
|
+
|
20
|
+
raise 'No dst found in deployment configuration' if dst.nil?
|
21
|
+
raise 'dst requires no trailing slash' if dst[-1, 1] == '/'
|
22
|
+
|
23
|
+
if dry_run
|
24
|
+
warn 'Performing a dry-run; no actions will actually be performed'
|
25
|
+
run_shell_cmd(['echo', 'scp', options, src, dst].flatten)
|
26
|
+
else
|
27
|
+
run_shell_cmd(['scp', options, src, dst].flatten)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def run_shell_cmd(cmd)
|
34
|
+
piper = Nanoc::Extra::Piper.new(stdout: $stdout, stderr: $stderr)
|
35
|
+
piper.run(cmd, nil)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/nanoc_scp.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'nanoc/extra/deployers'
|
data/nanoc-scp.gemspec
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.name = 'nanoc-scp'
|
3
|
+
gem.version = '0.0.0'
|
4
|
+
gem.summary = 'Nanoc scp deploy plugin'
|
5
|
+
gem.description = 'Very simple nanoc plugin for deploy via scp'
|
6
|
+
gem.authors = ['Mikhail Petrov (aka mixael)']
|
7
|
+
gem.email = 'spambox@mix86.ru'
|
8
|
+
gem.files = `git ls-files`.split($/)
|
9
|
+
gem.require_paths = ['lib']
|
10
|
+
|
11
|
+
gem.add_development_dependency 'bundler', '~> 1.9'
|
12
|
+
|
13
|
+
gem.homepage = 'https://github.com/mix86/nanoc-scp'
|
14
|
+
gem.license = 'MIT'
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nanoc-scp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mikhail Petrov (aka mixael)
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
description: Very simple nanoc plugin for deploy via scp
|
28
|
+
email: spambox@mix86.ru
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- ".gitignore"
|
34
|
+
- LICENSE
|
35
|
+
- README.md
|
36
|
+
- lib/nanoc/extra/deployers.rb
|
37
|
+
- lib/nanoc/extra/deployers/scp.rb
|
38
|
+
- lib/nanoc_scp.rb
|
39
|
+
- nanoc-scp.gemspec
|
40
|
+
homepage: https://github.com/mix86/nanoc-scp
|
41
|
+
licenses:
|
42
|
+
- MIT
|
43
|
+
metadata: {}
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
requirements: []
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 2.4.3
|
61
|
+
signing_key:
|
62
|
+
specification_version: 4
|
63
|
+
summary: Nanoc scp deploy plugin
|
64
|
+
test_files: []
|