roper 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/README.rdoc +89 -0
- data/exe/roper +2 -4
- data/lib/roper/cli.rb +2 -2
- data/lib/roper/driver.rb +2 -4
- data/lib/roper/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0ad48f2f248b7939ebed67f5d97141368b0049d
|
4
|
+
data.tar.gz: 92bd374b91ae055b5afe465bcdfffca13d6adcd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93896c718206ff2452f2cc456b12d1f2593b6004ee2c3c0301d2a14cee96c2d7bf8c29796712d43a1df690d274b3f015dbfea74e882eb8f664b0c668d9b19608
|
7
|
+
data.tar.gz: c179484f12d93694a343f337a98589633caa4d92bc3c7c86caae49ceaa7955c17b56e31140fdebd222512ba3d9d2ad08897e1dcccd4ba025fbf03eeabdba0296
|
data/README.md
CHANGED
@@ -47,9 +47,9 @@ Or install it yourself as:
|
|
47
47
|
|
48
48
|
## Usage
|
49
49
|
|
50
|
-
`roper lasso
|
50
|
+
`roper lasso --repo=<user>/<repo> [--branch=<branch>] [--status_url=<url>]`
|
51
51
|
|
52
|
-
`roper release
|
52
|
+
`roper release --repo=<user>/<repo>`
|
53
53
|
|
54
54
|
OR:
|
55
55
|
|
data/README.rdoc
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
= Roper {<img src="https://travis-ci.org/tulibraries/roper.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/tulibraries/roper]
|
2
|
+
|
3
|
+
Roper is a cli tool used to help stage a dockerized web app. There are some
|
4
|
+
assumptions made about the environment that roper runs in. The main one is
|
5
|
+
that traefik has been configured to run via the docker backend and that the
|
6
|
+
dockerized web application uses a docker-compose.yml file that knows how to
|
7
|
+
communicate with traefik.
|
8
|
+
|
9
|
+
Another assuption made is that the repository for the web applications roper is
|
10
|
+
concerned with lives at GitHub: At this point I have no intention of supporting
|
11
|
+
another git repository service.
|
12
|
+
|
13
|
+
Once Roper is configured it knows how to:
|
14
|
+
* Post to a GitHub branch PR with an in progress status for the
|
15
|
+
stage site setup.
|
16
|
+
* Pull in a repo locally.
|
17
|
+
* Checkout a specific branch.
|
18
|
+
* Start docker-compose session
|
19
|
+
* Post back to GitHub branch PR with link for QA site or failure
|
20
|
+
status.
|
21
|
+
* When a PR is merged or closed the resources can be released/recovered.
|
22
|
+
|
23
|
+
At this point Roper only defines a cli interface so there is no way for GitHub
|
24
|
+
to communicate with it direclty via a webhook or whatnot. It's assumed that it
|
25
|
+
will be used in conjuction with a service like jenkins ci to handle the webook
|
26
|
+
part of the communication and trigger a roper staging on a desired Github event
|
27
|
+
(PR creation, update to PR, merge of PR).
|
28
|
+
|
29
|
+
Eventually it would be nice for Roper to include a web service interface that
|
30
|
+
GitHub can post direclty to. But then again, that might just be scope creep
|
31
|
+
considering there are already good options for handling the webhook concern
|
32
|
+
(i.e. jenkins)
|
33
|
+
|
34
|
+
== Installation
|
35
|
+
|
36
|
+
Add this line to your application's Gemfile:
|
37
|
+
|
38
|
+
ruby gem 'roper'
|
39
|
+
|
40
|
+
And then execute:
|
41
|
+
|
42
|
+
$ bundle
|
43
|
+
|
44
|
+
Or install it yourself as:
|
45
|
+
|
46
|
+
$ gem install roper
|
47
|
+
|
48
|
+
== Usage
|
49
|
+
|
50
|
+
roper lasso --repo=<user>/<repo> [--branch=<branch>] [--status_url=<url>]
|
51
|
+
|
52
|
+
roper release --repo=<user>/<repo>
|
53
|
+
|
54
|
+
OR:
|
55
|
+
|
56
|
+
You can use the individual components of the library as you wish.
|
57
|
+
|
58
|
+
== Github Authentication
|
59
|
+
Currenlty Roper uses netrc for github authentication. I'm hoping to slap an interface to create this at setup but for now you will need to add a ~/.netrc file with an entry for <tt>api.github.com</tt> manually.
|
60
|
+
|
61
|
+
== Development
|
62
|
+
|
63
|
+
After checking out the repo, run <tt>bin/setup</tt> to install dependencies. Then, run
|
64
|
+
<tt>rake spec</tt> to run the tests. You can also run <tt>bin/console</tt> for an interactive
|
65
|
+
prompt that will allow you to experiment.
|
66
|
+
|
67
|
+
To install this gem onto your local machine, run <tt>bundle exec rake install</tt>. To
|
68
|
+
release a new version, update the version number in <tt>version.rb</tt>, and then run
|
69
|
+
<tt>bundle exec rake release</tt>, which will create a git tag for the version, push
|
70
|
+
git commits and tags, and push the <tt>.gem</tt> file to
|
71
|
+
{rubygems.org}[https://rubygems.org].
|
72
|
+
|
73
|
+
== Contributing
|
74
|
+
|
75
|
+
Bug reports and pull requests are welcome on GitHub at
|
76
|
+
https://github.com/tulibraries/roper. This project is intended to be a safe,
|
77
|
+
welcoming space for collaboration, and contributors are expected to adhere to
|
78
|
+
the {Contributor Covenant}[http://contributor-covenant.org] code of conduct.
|
79
|
+
|
80
|
+
== License
|
81
|
+
|
82
|
+
The gem is available as open source under the terms of the {MIT
|
83
|
+
License}[http://opensource.org/licenses/MIT].
|
84
|
+
|
85
|
+
== Code of Conduct
|
86
|
+
|
87
|
+
Everyone interacting in the Roper project’s codebases, issue trackers, chat
|
88
|
+
rooms and mailing lists is expected to follow the {code of
|
89
|
+
conduct}[https://github.com/tulibraries/roper/blob/master/CODE_OF_CONDUCT.md].
|
data/exe/roper
CHANGED
@@ -61,12 +61,10 @@ command :release do |c|
|
|
61
61
|
end
|
62
62
|
|
63
63
|
pre do |global, command, options, args|
|
64
|
-
if args.count > 0
|
65
|
-
raise "Unexpected arguments, this command does not take any arguments."
|
66
|
-
end
|
67
64
|
|
68
65
|
if command.name == :lasso
|
69
|
-
|
66
|
+
help_now! "--repo is required" unless !options[:repo].nil?
|
67
|
+
help_now! "Protocol must be either 'http' or 'https'" unless ["http", "https"].include?(options[:protocol])
|
70
68
|
end
|
71
69
|
|
72
70
|
# Pre logic here
|
data/lib/roper/cli.rb
CHANGED
@@ -49,13 +49,13 @@ module Roper
|
|
49
49
|
|
50
50
|
def status_url
|
51
51
|
status_url = @options[:status_url]
|
52
|
-
status_url ? {
|
52
|
+
status_url ? { target_url: status_url } : {}
|
53
53
|
end
|
54
54
|
|
55
55
|
def success_url
|
56
56
|
protocol = @options[:protocol] || "https"
|
57
57
|
domain = @options[:domain] || ENV["DOMAIN"]
|
58
|
-
{
|
58
|
+
{ target_url: "#{protocol}://#{@branch}.#{domain}" }
|
59
59
|
end
|
60
60
|
|
61
61
|
def status_pending
|
data/lib/roper/driver.rb
CHANGED
@@ -8,17 +8,15 @@ module Roper
|
|
8
8
|
@repo = Octokit::Repository.new(repo)
|
9
9
|
@branch = branch
|
10
10
|
@mount_path = Roper::mount_path(repo, branch)
|
11
|
-
@compose = Docker::Compose.new
|
11
|
+
@compose = Docker::Compose::Session.new(dir: @mount_path)
|
12
12
|
end
|
13
13
|
|
14
14
|
def up
|
15
|
-
Dir.chdir(@mount_path)
|
16
15
|
set_env_variables
|
17
|
-
@compose.up
|
16
|
+
@compose.up(detached: true)
|
18
17
|
end
|
19
18
|
|
20
19
|
def down
|
21
|
-
Dir.chdir(@mount_path)
|
22
20
|
@compose.down
|
23
21
|
end
|
24
22
|
|
data/lib/roper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Kinzer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-compose
|
@@ -267,6 +267,7 @@ files:
|
|
267
267
|
- Guardfile
|
268
268
|
- LICENSE.txt
|
269
269
|
- README.md
|
270
|
+
- README.rdoc
|
270
271
|
- Rakefile
|
271
272
|
- bin/console
|
272
273
|
- bin/setup
|