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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f55471893a985333ae259a60a6673d9d1e14f4d3
4
- data.tar.gz: 5b53c810c583a03697dbda89ce40a913bcf4a9ed
3
+ metadata.gz: b0ad48f2f248b7939ebed67f5d97141368b0049d
4
+ data.tar.gz: 92bd374b91ae055b5afe465bcdfffca13d6adcd0
5
5
  SHA512:
6
- metadata.gz: 8491d4579ccc48941a5bc57188a3736f9185eeaea4964a33f0e28fcfc3b1f4ddf8b1ef8f1ac790378f9f0088fcea1bc7bcafb54ff75a185f40a6b67755bb701c
7
- data.tar.gz: 4e36caead27d603da5816e507f1261ca3770052aff9be44161686948a321eb239115a2cf322663efb583ac1d93210ba68fe9b66c46ebdcdf903b8f3e05098c98
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 "--repo=<REPO_OWNER>/<REPO_NAME>" [--branch=<BRANCH_NAME>] [--status-url=<STATUS_URL>]`
50
+ `roper lasso --repo=<user>/<repo> [--branch=<branch>] [--status_url=<url>]`
51
51
 
52
- `roper release "--repo=<REPO_OWNER>/<REPO_NAME>" [--branch=<BRANCH_NAME>]`
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
- raise "Protocol must be either 'http' or 'https'" unless ["http", "https"].include?(options[:protocol])
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 ? { status_url: 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
- { status_url: "#{protocol}://#{@branch}.#{domain}" }
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Roper
4
- VERSION = "1.0.0.rc2"
4
+ VERSION = "1.0.0.rc3"
5
5
  end
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.rc2
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-13 00:00:00.000000000 Z
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