arethusa-cli 0.1.4 → 0.1.5

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: ca1411e1523a3dc010f744aa5102cf4177d6c21b
4
- data.tar.gz: 4d8565d101112e3446ac0256774a1a46d05c914d
3
+ metadata.gz: 14e29348d945f3d8d08493d1501b8396882cd236
4
+ data.tar.gz: d4dcaa9f3631ce4e865545c4db2015d6f707c3b6
5
5
  SHA512:
6
- metadata.gz: 3e243dbce17de1e164774886f9c4f3a68381087e500365a44f9bcf1f3f78c3c58adab370c1998208a37a99fdf5a5b99f3c416600d6fcec95209ac6a8fd65745d
7
- data.tar.gz: d4497f9a0104ed6694908a3334423dc0d1ed2eb437d3aaecd314ba6d4e65420ef2737668fe53e404074343681c44edeee78f90643c0951bbb42d3731451a150b
6
+ metadata.gz: fe8b6ec67cf4b514db93c456bcb662d87996f0b19f12af187d3044933441a652bfb9d60bf789ed92ae73dca5347ee206f677a5d135766b00bbfb39b167534390
7
+ data.tar.gz: d6cb31f7e179feaee206f29836f4b9da1b97885adc6f14234eeb9d253e964ae85b58b5ddc8b300db6249edc8128c7984e75252ec833a449b1ad74bd1b18dda8f
@@ -1,5 +1,5 @@
1
1
  module Arethusa
2
2
  class CLI
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
data/lib/arethusa/cli.rb CHANGED
@@ -53,9 +53,11 @@ EOF
53
53
  desc: 'Deploys only Arethusa files without third party code'
54
54
  method_option :minify, aliases: '-m', type: :boolean, default: true,
55
55
  desc: 'Minifies Arethusa before building'
56
+ method_option :commit, aliases: '-c', type: :boolean,
57
+ desc: 'Deploy in a subfolder, referenced by the current commit sha'
56
58
  def deploy(address, directory)
57
59
  @address = address
58
- @directory = directory
60
+ @directory = options[:commit] ? File.join(directory, short_sha) : directory
59
61
  @ssh_options = options[:options]
60
62
  @archive = options[:file]
61
63
 
@@ -158,6 +160,7 @@ EOF
158
160
 
159
161
  # For deploy command
160
162
  def execute
163
+ `#{ssh} mkdir -p #{@directory}`
161
164
  `#{archive_to_use} | #{ssh} #{decompress}`
162
165
  end
163
166
 
@@ -165,6 +168,10 @@ EOF
165
168
  "tar -zc #{folders_to_deploy.join(' ')}"
166
169
  end
167
170
 
171
+ def short_sha
172
+ `git rev-parse --short HEAD`
173
+ end
174
+
168
175
  def archive_to_use
169
176
  @archive ? "cat #{@archive}" : compress
170
177
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arethusa-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - LFDM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2014-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler