veyor 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0821bd7d2a3b69705049ea80098e753c5be9e3f3
4
- data.tar.gz: d66b1356c7c6f27f6918a349db03246cdda95496
3
+ metadata.gz: a06e1104f3842fce3aa56563fceec712abf66b87
4
+ data.tar.gz: cd02f3925f0a18c0c123547117e1e0639970c405
5
5
  SHA512:
6
- metadata.gz: 0527f3b33a4aa3e9403c06c9249e8d97595b4b91112b2a07cdfc9a6e5c0294d43319a1172bc76b071052598b8f1aaf563427cde8ad46593ec500c027a5a3f16d
7
- data.tar.gz: ba720ed12269b34fe1c30283bfaec1b318577c3677a058c69e0d58cd0310d44f17257c76ae667a9c779be4d75d93095e2819bc1b0f7f93962bf9333bd3645764
6
+ metadata.gz: 8b1829be8ade8096598eee422bf1526f1817f2ffb2ef8ba86718c4d64cec50f7a0e5fb384c2ea78823773a52656c94a753f86c59cf0eb04d661f5f0b20bfc65b
7
+ data.tar.gz: fffc01b5a2c4351a824e400ce302543350cc1e360cea99637f40f0841dbf4ad1afad2466f54cb0e62ee356b99e4e9aac221725519f07e55f08518c4ea6139d4e
@@ -1,3 +1,12 @@
1
+ ## 0.1.2 (2016-06-24)
2
+
3
+ * Command line client now with all methods available
4
+ in `veyor`
5
+
6
+ ## 0.1.1 (2016-06-20)
7
+
8
+ * Fixed command line client
9
+
1
10
  ## 0.1.0 (2016-06-20)
2
11
 
3
12
  * first Rubygems release
data/README.md CHANGED
@@ -96,9 +96,14 @@ veyor
96
96
 
97
97
  ```
98
98
  Commands:
99
- veyor help [COMMAND] # Describe available commands or one specific command
100
- veyor project [Name] # List a project
101
- veyor projects # List projects
99
+ veyor cancel [Name] --version=VERSION # Cancel build of branch of most recent commit
100
+ veyor deployments [Name] # Get project deployments
101
+ veyor help [COMMAND] # Describe available commands or one specific command
102
+ veyor history [Name] # Get project history
103
+ veyor project [Name] # List a project
104
+ veyor projects # List projects
105
+ veyor settings [Name] # List a project's settings
106
+ veyor start [Name] # Start build of branch of most recent commit
102
107
  ```
103
108
 
104
109
  List your projects
data/bin/veyor CHANGED
@@ -3,6 +3,7 @@
3
3
  require "thor"
4
4
  require "veyor"
5
5
  require "multi_json"
6
+ require "date"
6
7
 
7
8
  class Yey < Thor
8
9
 
@@ -60,8 +61,9 @@ class Yey < Thor
60
61
  "cancelled"
61
62
  LONGDESC
62
63
  option :json, :type => :boolean, :default => false
64
+ option :account, :type => :string, :default => nil
63
65
  def project(name)
64
- out = Veyor.project(project: name)
66
+ out = Veyor.project(project: name, account: options[:account])
65
67
  if out.keys.length == 1 and out.keys[0] == "message"
66
68
  puts "project not found"
67
69
  else
@@ -78,6 +80,170 @@ class Yey < Thor
78
80
  end
79
81
  end
80
82
 
83
+
84
+ desc "history [Name]", "Get project history"
85
+ long_desc <<-LONGDESC
86
+ `veyor history` get's project history
87
+
88
+ # Get project history
89
+ \x5$ veyor history cowsay
90
+
91
+ # Get project history - start at
92
+ \x5$ veyor history cowsay --start_build=2872582
93
+
94
+ # Get project history - certain branch
95
+ \x5$ veyor history cowsay --branch='changeback'
96
+
97
+ # Get project history - limit results
98
+ \x5$ veyor history cowsay --limit=3
99
+
100
+ # Get project history - json, parse with jq
101
+ \x5$ veyor history cowsay --json | jq .builds[].message
102
+ LONGDESC
103
+ option :json, :type => :boolean, :default => false
104
+ option :account, :type => :string, :default => nil
105
+ option :branch, :type => :string, :default => 'master'
106
+ option :start_build, :type => :numeric, :default => nil
107
+ option :limit, :type => :numeric, :default => 10
108
+ def history(name)
109
+ out = Veyor.project_history(project: name, account: options[:account],
110
+ limit: options[:limit], start_build: options[:start_build],
111
+ branch: options[:branch])
112
+ if out.keys.length == 1 and out.keys[0] == "message"
113
+ puts "project not found"
114
+ else
115
+ if !options[:json]
116
+ puts 'project: ' + out['project']['name']
117
+ puts 'Builds ----------'
118
+ out['builds'].each do |x|
119
+ puts ' build ID: ' + x['buildId'].to_s
120
+ puts ' build #: ' + x['buildNumber'].to_s
121
+ puts ' build version: ' + x['version']
122
+ puts ' build status: ' + x['status'].upcase
123
+ puts ' created: ' + DateTime.parse(x['created']).to_time.to_s
124
+ puts
125
+ end
126
+ puts
127
+ else
128
+ puts MultiJson.encode(out)
129
+ end
130
+ end
131
+ end
132
+
133
+
134
+ desc "deployments [Name]", "Get project deployments"
135
+ long_desc <<-LONGDESC
136
+ `veyor deployments` get a project's deployments - gives back only JSON for now
137
+
138
+ # Get deployments for a project
139
+ \x5$ veyor deployments cowsay
140
+ LONGDESC
141
+ option :account, :type => :string, :default => nil
142
+ def deployments(name)
143
+ out = Veyor.project_deployments(account: options[:account], project: name)
144
+ if out.keys.length == 1 and out.keys[0] == "message"
145
+ puts "project not found"
146
+ else
147
+ puts MultiJson.encode(out)
148
+ end
149
+ end
150
+
151
+
152
+ desc "settings [Name]", "List a project's settings"
153
+ long_desc <<-LONGDESC
154
+ `veyor settings` list a project's settings
155
+
156
+ # Get settings for a project
157
+ \x5$ veyor settings cowsay
158
+ LONGDESC
159
+ option :json, :type => :boolean, :default => false
160
+ option :account, :type => :string, :default => nil
161
+ def settings(name)
162
+ out = Veyor.project_settings(account: options[:account], project: name)
163
+ if out.keys.length == 1 and out.keys[0] == "message"
164
+ puts "project not found"
165
+ else
166
+ if !options[:json]
167
+ puts 'project: ' + out['project']['name']
168
+ puts 'repository: ' + out['project']['repositoryName']
169
+ puts 'projectId: ' + out['project']['projectId'].to_s
170
+ puts 'accountId: ' + out['project']['accountId'].to_s
171
+ puts 'accountName: ' + out['project']['accountName']
172
+ puts 'repositoryType: ' + out['project']['repositoryType']
173
+ puts 'repositoryScm: ' + out['project']['repositoryScm']
174
+ puts 'repositoryName: ' + out['project']['repositoryName']
175
+ puts 'isPrivate: ' + out['project']['isPrivate'].to_s
176
+ puts 'skipBranchesWithoutAppveyorYml: ' + out['project']['skipBranchesWithoutAppveyorYml'].to_s
177
+ puts 'enableSecureVariablesInPullRequests: ' + out['project']['enableSecureVariablesInPullRequests'].to_s
178
+ puts 'enableDeploymentInPullRequests: ' + out['project']['enableDeploymentInPullRequests'].to_s
179
+ puts 'rollingBuilds: ' + out['project']['rollingBuilds'].to_s
180
+ puts 'alwaysBuildClosedPullRequests: ' + out['project']['alwaysBuildClosedPullRequests'].to_s
181
+ puts 'scheduleCrontabExpression: ' + out['settings']['scheduleCrontabExpression'].to_s
182
+ puts 'versionFormat: ' + out['settings']['versionFormat'].to_s
183
+ puts 'repositoryType: ' + out['settings']['repositoryType'].to_s
184
+ puts 'webhookId: ' + out['settings']['webhookId'].to_s
185
+ puts 'webhookUrl: ' + out['settings']['webhookUrl'].to_s
186
+ puts
187
+ else
188
+ puts MultiJson.encode(out)
189
+ end
190
+ end
191
+ end
192
+
193
+
194
+ desc "start [Name]", "Start build of branch of most recent commit"
195
+ long_desc <<-LONGDESC
196
+ `veyor start` name
197
+
198
+ \x5$ veyor start ccafs
199
+
200
+ \x5$ veyor start ccafs --branch=dev
201
+
202
+ \x5$ veyor start ccafs --account=foobar --branch=dev
203
+ LONGDESC
204
+ option :json, :type => :boolean, :default => false
205
+ option :account, :type => :string, :default => nil
206
+ option :branch, :type => :string, :default => 'master'
207
+ def start(name)
208
+ out = Veyor.build_start(account: options[:account], project: name, branch: options[:branch])
209
+ if out.keys.length == 1 and out.keys[0] == "message"
210
+ puts "project not found"
211
+ else
212
+ if !options[:json]
213
+ puts 'project: ' + name
214
+ puts 'build ID: ' + out['buildId'].to_s
215
+ puts 'build #: ' + out['buildNumber'].to_s
216
+ puts 'version: ' + out['version']
217
+ puts 'branch: ' + out['branch']
218
+ puts 'message: ' + out['message']
219
+ puts 'author: ' + out['authorUsername']
220
+ puts 'status: ' + out['status']
221
+
222
+ puts
223
+ else
224
+ puts MultiJson.encode(out)
225
+ end
226
+ end
227
+ end
228
+
229
+ desc "cancel [Name]", "Cancel build of branch of most recent commit"
230
+ long_desc <<-LONGDESC
231
+ `veyor cancel`
232
+
233
+ \x5$ veyor cancel ccafs --version=1.0.41
234
+ LONGDESC
235
+ option :account, :type => :string, :default => nil
236
+ option :version, :type => :string, :required => true
237
+ def cancel(name)
238
+ out = Veyor.build_cancel(account: options[:account], project: name, version: options[:version])
239
+ if out.class == Fixnum and out == 204
240
+ puts "build %s cancelled" % options[:version]
241
+ else
242
+ puts "error\n"
243
+ puts out
244
+ end
245
+ end
246
+
81
247
  end
82
248
 
83
249
  Yey.start(ARGV)
@@ -1,3 +1,3 @@
1
1
  module Veyor
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.version = Veyor::VERSION
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.required_ruby_version = '>= 2.0'
11
- s.date = '2016-06-20'
11
+ s.date = '2016-06-24'
12
12
  s.summary = "Appveyor Ruby Client"
13
13
  s.description = "Low Level Ruby Client for the Appveyor API"
14
14
  s.authors = "Scott Chamberlain"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veyor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chamberlain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2016-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler