activiti_mirror 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b7fc1c51e6f8ebc3f3c7e8aacac04dabcf50f2ac
4
+ data.tar.gz: 7d82cd015a35b3d8c68568e891bd4fe3d2220925
5
+ SHA512:
6
+ metadata.gz: 4998292dca4f1b17d3a21b6293068237eaac375a610a18be4774717da9012fd180fa0f4d7de24074636f1d3b28d3af1d27ef78c3e7bf3270ff4ba63c8de4f18d
7
+ data.tar.gz: d26720625bdd5066fc0681ed66c20bd20c6c6fde56eb5c5f731cf57feed61cb54af39ad9152386177a9e789710f4838ab6259af75f3dc64b132b7b36183fcff8
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ results.html
3
+ pkg
4
+ html
@@ -0,0 +1 @@
1
+ activiti_mirror
@@ -0,0 +1 @@
1
+ 2.1.5
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in activiti_mirror.gemspec
4
+ gemspec
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ activiti_mirror (0.1.0)
5
+ methadone (~> 1.9.3)
6
+ sshkit
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ aruba (0.14.2)
12
+ childprocess (~> 0.5.6)
13
+ contracts (~> 0.9)
14
+ cucumber (>= 1.3.19)
15
+ ffi (~> 1.9.10)
16
+ rspec-expectations (>= 2.99)
17
+ thor (~> 0.19)
18
+ builder (3.2.2)
19
+ childprocess (0.5.9)
20
+ ffi (~> 1.0, >= 1.0.11)
21
+ contracts (0.14.0)
22
+ cucumber (2.4.0)
23
+ builder (>= 2.1.2)
24
+ cucumber-core (~> 1.5.0)
25
+ cucumber-wire (~> 0.0.1)
26
+ diff-lcs (>= 1.1.3)
27
+ gherkin (~> 4.0)
28
+ multi_json (>= 1.7.5, < 2.0)
29
+ multi_test (>= 0.1.2)
30
+ cucumber-core (1.5.0)
31
+ gherkin (~> 4.0)
32
+ cucumber-wire (0.0.1)
33
+ diff-lcs (1.2.5)
34
+ ffi (1.9.14)
35
+ gherkin (4.0.0)
36
+ methadone (1.9.3)
37
+ bundler
38
+ multi_json (1.12.1)
39
+ multi_test (0.1.2)
40
+ net-scp (1.2.1)
41
+ net-ssh (>= 2.6.5)
42
+ net-ssh (3.2.0)
43
+ rake (10.5.0)
44
+ rdoc (5.0.0)
45
+ rspec-expectations (3.5.0)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.5.0)
48
+ rspec-support (3.5.0)
49
+ sshkit (1.11.4)
50
+ net-scp (>= 1.1.2)
51
+ net-ssh (>= 2.8.0)
52
+ thor (0.19.4)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ activiti_mirror!
59
+ aruba
60
+ bundler (~> 1.10)
61
+ rake (~> 10.0)
62
+ rdoc
63
+
64
+ BUNDLED WITH
65
+ 1.13.6
@@ -0,0 +1,8 @@
1
+ Name: activiti_mirror
2
+ Copyright (c) 2016 xiajian
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,91 @@
1
+ # ActivitiMirror
2
+
3
+ activiti_mirror is a tool, which use to upload activit file to qiniu and download it
4
+
5
+ 想法来源于: http://bbs.yundianjia.net/d/225-activiti
6
+
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'activiti_mirror'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install activiti_mirror
23
+
24
+ ## Usage
25
+
26
+ 命令行使用:
27
+
28
+ ```
29
+ Usage: activiti_mirror [options]
30
+
31
+ activiti_mirror is a tool, which use to upload activit file to qiniu and download it!
32
+
33
+ v0.1.0
34
+
35
+ Options:
36
+ -h, --help Show command line help
37
+ --version Show help/version info
38
+ --verbose Be verbose
39
+ -H REMOTE_SERVER_ADDRESS, Host server Address
40
+ --host-address
41
+ --log-level LEVEL Set the logging level
42
+ (debug|info|warn|error|fatal)
43
+ (Default: info)
44
+ ```
45
+
46
+ 编程使用:
47
+
48
+ ```
49
+ options = {
50
+ version: '5.22.0',
51
+ hosts: %w(username@192.156.23.56)
52
+ }
53
+
54
+ ActivitiMirror.command options
55
+ ```
56
+
57
+ 使用例子:
58
+
59
+
60
+ ```
61
+ 上传成功!
62
+ 链接为: http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.22.0.zip
63
+ ```
64
+
65
+ 一些CDN 链接:
66
+
67
+
68
+ http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.22.0.zip
69
+ http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.21.0.zip
70
+ http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.19.0.zip
71
+ http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.18.0.zip
72
+ http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.17.0.zip
73
+ http://ognvcf5x6.bkt.clouddn.com/bbs_image/activiti-5.16.4.zip
74
+
75
+ > PS: 之所以会产生这个,原因还是国内的伟大的 GFW 的功劳。
76
+
77
+ ## Development
78
+
79
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
80
+
81
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
82
+
83
+ ## Contributing
84
+
85
+ Bug reports and pull requests are welcome on GitHub at https://github.com/xiajian/activiti_mirror. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
86
+
87
+
88
+ ## License
89
+
90
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
91
+
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'activiti_mirror/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "activiti_mirror"
8
+ spec.version = ActivitiMirror::VERSION
9
+ spec.authors = ["xiajian"]
10
+ spec.email = ["jhqy2011@gmail.com"]
11
+
12
+ spec.summary = %q{activiti_mirror is a tool, which use to upload activit file to qiniu and download it}
13
+ spec.description = %q{activiti_mirror is a tool, which use to upload activit file to qiniu and download it}
14
+ spec.homepage = "https://github.com/xiajian/activiti_mirror"
15
+ spec.license = "mit"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "bin"
27
+ spec.executables = ["activiti_mirror"]
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency('methadone', '~> 1.9.3')
31
+ spec.add_dependency 'sshkit'
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.10"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency('rdoc')
36
+ spec.add_development_dependency('aruba')
37
+
38
+ end
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'methadone'
5
+ require "bundler/setup"
6
+ require 'activiti_mirror'
7
+
8
+ class App
9
+ include Methadone::Main
10
+ include Methadone::CLILogging
11
+
12
+ main do
13
+ if ARGV.empty? || ARGV.length < 1
14
+ puts 'Usage "activiti_mirror version"'
15
+ puts ' "activiti_mirror -h" for more infomation'
16
+ exit 1
17
+ end
18
+
19
+ options[:version] = ARGV[0]
20
+
21
+ unless options[:H].nil? || options[:H].empty?
22
+ options[:hosts] = ([] << options[:H])
23
+ end
24
+
25
+ # puts options
26
+
27
+ ActivitiMirror.command options
28
+ end
29
+
30
+ version ActivitiMirror::VERSION
31
+
32
+ description 'activiti_mirror is a tool, which use to upload activit file to qiniu and download it!'
33
+
34
+ on("--verbose","Be verbose")
35
+
36
+ on("-H REMOTE_SERVER_ADDRESS","--host-address","Host server Address", /^\w+@\d+\.\d+\.\d+\.\d+$/)
37
+
38
+ use_log_level_option :toggle_debug_on_signal => 'USR1'
39
+
40
+ go!
41
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "activiti_mirror"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,32 @@
1
+ require "activiti_mirror/version"
2
+ require 'sshkit'
3
+ require 'sshkit/dsl'
4
+
5
+ module ActivitiMirror
6
+ include SSHKit::DSL
7
+
8
+ def download_activiti_by_version(hosts, version = '5.18.0')
9
+ activiti_filename = "activiti-#{version}.zip"
10
+ activiti_url = "https://github.com/Activiti/Activiti/releases/download/activiti-#{version}/#{activiti_filename}"
11
+
12
+ on hosts, in: :sequence, wait: 5 do |host|
13
+ unless test("[ -f activiti/#{activiti_filename} ]")
14
+ within "activiti" do
15
+ execute(:wget, activiti_url)
16
+ end
17
+ else
18
+ puts capture(:echo, "#{activiti_filename} is exists, it cannot be download again!!!")
19
+ end
20
+ puts capture("source /etc/profile.d/rvm.sh; cd ~/activiti; bbs_uploader ./#{activiti_filename}")
21
+ end
22
+ end
23
+
24
+ def command(options = {})
25
+ hosts = options.delete(:hosts) || %w{root@188.166.209.243}
26
+ version = options.delete(:version)
27
+
28
+ download_activiti_by_version hosts, version
29
+ end
30
+
31
+ extend self
32
+ end
@@ -0,0 +1,3 @@
1
+ module ActivitiMirror
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,148 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activiti_mirror
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - xiajian
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: methadone
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.9.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.9.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: sshkit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: aruba
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: activiti_mirror is a tool, which use to upload activit file to qiniu
98
+ and download it
99
+ email:
100
+ - jhqy2011@gmail.com
101
+ executables:
102
+ - activiti_mirror
103
+ extensions: []
104
+ extra_rdoc_files: []
105
+ files:
106
+ - ".gitignore"
107
+ - ".ruby-gemset"
108
+ - ".ruby-version"
109
+ - ".travis.yml"
110
+ - CODE_OF_CONDUCT.md
111
+ - Gemfile
112
+ - Gemfile.lock
113
+ - LICENSE.txt
114
+ - README.md
115
+ - Rakefile
116
+ - activiti_mirror.gemspec
117
+ - bin/activiti_mirror
118
+ - bin/console
119
+ - bin/setup
120
+ - lib/activiti_mirror.rb
121
+ - lib/activiti_mirror/version.rb
122
+ homepage: https://github.com/xiajian/activiti_mirror
123
+ licenses:
124
+ - mit
125
+ metadata:
126
+ allowed_push_host: https://rubygems.org
127
+ post_install_message:
128
+ rdoc_options: []
129
+ require_paths:
130
+ - lib
131
+ required_ruby_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ requirements: []
142
+ rubyforge_project:
143
+ rubygems_version: 2.6.6
144
+ signing_key:
145
+ specification_version: 4
146
+ summary: activiti_mirror is a tool, which use to upload activit file to qiniu and
147
+ download it
148
+ test_files: []