opsask 2.0.14 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Readme.md +72 -1
- data/VERSION +1 -1
- data/lib/opsask/main.rb +26 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 684e95a8d720907abd8feb1b2a0f735cb3007165
|
4
|
+
data.tar.gz: 4c861f36f2c5935ccfe6a67211786b93708b2577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0509da3102cca736a57ec2cffa21d7417060daedb9e032c8f61ddc2357deeb5ce7ade8850d03671ab4209e73595ff238575d91d378e9f5e4d0c9e0cafe810a19
|
7
|
+
data.tar.gz: fcdc38a7e4f5270acf4401c946add892ede593acae992685706e2026fe982bae25d5177443ead1901125db930b009b3d55f2b15c021f6c39e5476e3499a0242b
|
data/Readme.md
CHANGED
@@ -1,3 +1,74 @@
|
|
1
1
|
# OpsAsk
|
2
2
|
|
3
|
-
Ask Ops for things.
|
3
|
+
Ask Ops for things.
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
$ opsask help
|
11
|
+
Commands:
|
12
|
+
opsask art # Show the application art
|
13
|
+
opsask help [COMMAND] # Describe available commands or one specific command
|
14
|
+
opsask server # Start application web server
|
15
|
+
opsask version # Show the application version
|
16
|
+
|
17
|
+
You're probably most interested in the `server` command:
|
18
|
+
|
19
|
+
$ opsask help server
|
20
|
+
Usage:
|
21
|
+
opsask server -c, --config=CONFIG
|
22
|
+
|
23
|
+
Options:
|
24
|
+
-c, --config=CONFIG # Path to configuration file
|
25
|
+
-p, [--port=N] # Set Sinatra port
|
26
|
+
# Default: 3000
|
27
|
+
-e, [--environment=ENVIRONMENT] # Set Sinatra environment
|
28
|
+
# Default: development
|
29
|
+
-b, [--bind=BIND] # Set Sinatra interface
|
30
|
+
# Default: 0.0.0.0
|
31
|
+
|
32
|
+
Start application web server
|
33
|
+
|
34
|
+
|
35
|
+
## Configuration
|
36
|
+
|
37
|
+
Configuration is JSON:
|
38
|
+
|
39
|
+
{
|
40
|
+
"assignee": "some_user", // This user will be assigned
|
41
|
+
"jira_user": "another_user", // This user will file JIRAs
|
42
|
+
"jira_pass": "some_really_strong_password", // We'll need the password, too
|
43
|
+
"jira_url": "http://your.jira", // Base URL for JIRA installation
|
44
|
+
"queue_size": 5, // Limit submissions per day
|
45
|
+
"cutoff_hour": 18, // Stop submissions after this hour
|
46
|
+
"project_key": "TEST", // Project to file JIRAs under
|
47
|
+
"project_name": "Test", // We also need the full name
|
48
|
+
"issue_type": "Task", // Kind of JIRA to file
|
49
|
+
"version": "Un-targeted", // If required by project
|
50
|
+
"jira_private_key": "/path/to/consumer.pem", // You probably generated it
|
51
|
+
"jira_consumer_key": "consumer-key", // Name associated with key
|
52
|
+
"require_label": "GoodLabel", // Scope to label (optional)
|
53
|
+
"ignore_label": "BadLabel" // Filter out label (optional)
|
54
|
+
}
|
55
|
+
|
56
|
+
To fill out `jira_private_key` and `jira_consumer_key`, you'll need to create
|
57
|
+
what JIRA calls an "Application Link" which is unfortunately non-trivial. Here
|
58
|
+
are some sample configuration values, which oughta help:
|
59
|
+
|
60
|
+
- *Applicaiton Name:* OpsAsk
|
61
|
+
- *Application Type:* Generic Application
|
62
|
+
- *Service Provider Name:* Your Company, Inc.
|
63
|
+
- *Consumer Name:* OpsAsk
|
64
|
+
- *Consumer Key:* opsask
|
65
|
+
- *Shared secret:* opsask
|
66
|
+
- *Consumer Callback URL:* http://opsask/callback
|
67
|
+
- *Request Token URL:* http://jira/plugins/servlet/oauth/request-token
|
68
|
+
- *Access Token URL:* http://jira/plugins/servlet/oauth/access-token
|
69
|
+
- *Authorize URL:* http://jira/plugins/servlet/oauth/authorize
|
70
|
+
|
71
|
+
To generate a keypair:
|
72
|
+
|
73
|
+
$ openssl genrsa -out opsask.pem 1024
|
74
|
+
$ openssl rsa -in opsask.pem -pubout -out opsask.pub
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0
|
1
|
+
2.1.0
|
data/lib/opsask/main.rb
CHANGED
@@ -23,8 +23,26 @@ module OpsAsk
|
|
23
23
|
end
|
24
24
|
|
25
25
|
desc 'server', 'Start application web server'
|
26
|
-
option :
|
27
|
-
|
26
|
+
option :config, \
|
27
|
+
type: :string,
|
28
|
+
aliases: %w[ -c ],
|
29
|
+
desc: 'Path to configuration file',
|
30
|
+
required: true
|
31
|
+
option :port, \
|
32
|
+
type: :numeric,
|
33
|
+
aliases: %w[ -p ],
|
34
|
+
desc: 'Set Sinatra port',
|
35
|
+
default: 3000
|
36
|
+
option :environment, \
|
37
|
+
type: :string,
|
38
|
+
aliases: %w[ -e ],
|
39
|
+
desc: 'Set Sinatra environment',
|
40
|
+
default: 'development'
|
41
|
+
option :bind, \
|
42
|
+
type: :string,
|
43
|
+
aliases: %w[ -b ],
|
44
|
+
desc: 'Set Sinatra interface',
|
45
|
+
default: '0.0.0.0'
|
28
46
|
def server
|
29
47
|
config = {
|
30
48
|
ops_group: 'change-network-operations',
|
@@ -49,8 +67,12 @@ module OpsAsk
|
|
49
67
|
config.merge! JSON::parse(File.read(options[:config]), symbolize_names: true)
|
50
68
|
end
|
51
69
|
|
52
|
-
App.run!
|
53
|
-
|
70
|
+
App.run! \
|
71
|
+
config: config,
|
72
|
+
bind: options[:bind],
|
73
|
+
port: options[:port],
|
74
|
+
environment: options[:environment],
|
75
|
+
raise_errors: true
|
54
76
|
end
|
55
77
|
end
|
56
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|