overview 0.0.3.61 → 0.0.4.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmZhZTVjNjZkZTEwNTQ0YzFmNzE4Y2FjYjZkMDE1YjAxMTBkNTUxMA==
4
+ Y2Q0ZmMzNjVlYWIyNGQ3YWQxZjk5MDgxYTg3MWEyY2Y4ZTNkMWU1Mg==
5
5
  data.tar.gz: !binary |-
6
- MmYxNjEzZTc0MGZmNGRmYTYwZTViY2M5YmZkZTQ5MGU3YmJhY2Y1Yw==
6
+ MjJjNGE2YmUzMzc4NjNkNDZiYzc3MGEyMjQ0ZDgyZWUxMGRkZWFmMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmUyMDNiNzVhNmYxNDBmNjE3N2IyOWUyMmIxZDFlOTkyNGI4NmRhYjg0NTU0
10
- MzZiYTNmMmZlZTllZTQ2NjJmOGUwOGNjM2VjZDM1N2ZkOTQyYzg3MWM4ZmE0
11
- OTI0YmRjOGFmMDdkNTI1MmJlMDBlNTFjZmMzZmFiNTRjMmYxYWY=
9
+ MTcxZTQ0MDE3ZGQ0NGM0MjQxYjdiZjg0MzIyMTE3ZWIwNjRkMzQ4YTlmZTUy
10
+ OWViYzI5MmUyMGQ5NmU5YmM3MTEzOTk0MjEyYTI0OGEyMTRlN2YzZjMwMDM1
11
+ NWM2MDJhMWMyNGQ4ZGRiMmY1ZDIzYzc3NTFkYmRlMmM2ZWM4NGI=
12
12
  data.tar.gz: !binary |-
13
- NWQ2MDAyMWZhOTU2YTc5YmE5YmMwYTU4ZmJjZjY0ZGFkMmI2NGZmN2IxZWZj
14
- OTg3MWUyNjNkZjU5MWM4ZDdjN2QwM2RjMGY0MjE0ZmE0NTI5Y2ZhODVmMmFh
15
- ZGIyMDdiYjlhNWM4MmMzYTQ5Yjc2MzU4MTYwMmU2NDg3OTM0MjA=
13
+ NzE2OTdjOWYzMjBmZjUxMmMyNDAxMWI0ZDgyNmEzOGQxMTA2OGU0NGI1OWZi
14
+ ZDQwMTc4NGJjYjI1YmRmMTlmMDI4M2NjMzg3Mzc1NDUxYmVlYTMxODg0MWZj
15
+ N2QxYmQzNDQ5NGI3NTcwMWMwODY1NjFiNmI3YTc2MDI4MjM3YjY=
data/.gitignore CHANGED
@@ -1,2 +1,23 @@
1
1
  .idea
2
2
  Gemfile.lock
3
+
4
+ bin/overview.log
5
+
6
+ lib/overview.yml
7
+
8
+ lib/releases.yml
9
+
10
+ lib/overview.log
11
+
12
+ overview.log
13
+
14
+ lib/cache.yml
15
+
16
+ lib/changelog_apicache.yml
17
+
18
+ lib/github.cache
19
+
20
+ lib/github.yml
21
+
22
+ spec/coverage/
23
+ coverage/
data/.travis.yml CHANGED
@@ -7,14 +7,14 @@ notifications:
7
7
  email: false
8
8
  rvm:
9
9
  - 2.0.0
10
- before_script:
10
+ before_script:
11
11
  - bundle exec ./bin/overview appversion -r
12
12
  - bundle exec gem bump --version $(bundle exec ./bin/overview appversion -r | tail -1) --no-commit
13
13
  deploy:
14
14
  provider: rubygems
15
15
  api_key:
16
- secure: gh0GksPAZk6veUZpsfq15UwZfVgslrUaNcqsNapq2oCB4TiHX3e6UCF8xFfLJZriML9tQNZWtC2u61gzZWqG788rUVMuJRVTci99BNTqj4xrMfkhyqxLlRMB961jzo3vJU4cLNjjir6paZKsfwVdyPbHjZq973dVn6+2bPcmiHI=
16
+ secure: RU4uH/gIFJ7nZFRsINXV04bbJDNSpA4VhJcxDXxN+sOoiy107zr62GdrGm7YhMRAt5jeGPE8xX9MKwFxbJotLj0XAplkGrzx1L5B2tmxWoHRrNpb9IKyxu5Q9PWuch06jL7rQLW9BmaYZNtEiKUGSI9nD4291fV9r9vTNqiuj08=
17
17
  gem: overview
18
18
  on:
19
19
  tags: true
20
- repo: overllc/overview
20
+ repo: overhq/overview
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
- = overview {<img src="https://badge.fury.io/rb/overview.svg" alt="Gem Version" />}[http://badge.fury.io/rb/overview] {<img src="https://codeclimate.com/github/overllc/overview/badges/gpa.svg" />}[https://codeclimate.com/github/overllc/overview] {<img src="https://codeclimate.com/github/overllc/overview/badges/coverage.svg" />}[https://codeclimate.com/github/overllc/overview] {<img src="https://travis-ci.org/overllc/overview.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/overllc/overview]
1
+ = overview {<img src="https://badge.fury.io/rb/overview.svg" alt="Gem Version" />}[http://badge.fury.io/rb/overview] {<img src="https://codeclimate.com/github/overllc/overview/badges/gpa.svg" />}[https://codeclimate.com/github/overllc/overview] {<img src="https://codeclimate.com/github/overllc/overview/badges/coverage.svg" />}[https://codeclimate.com/github/overllc/overview] {<img src="https://travis-ci.org/overhq/overview.svg" alt="Build Status" />}[https://travis-ci.org/overhq/overview]
2
2
 
3
- Describe your project here
3
+ Config management tool to automate our iOS CI / CD process
4
4
 
5
5
  :include:overview.rdoc
6
6
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rdoc/task'
6
6
  Rake::RDocTask.new do |rd|
7
7
  rd.main = "README.rdoc"
8
8
  rd.rdoc_files.include("README.rdoc", "lib/**/*.rb", "bin/**/*")
9
- rd.title = 'Your application title'
9
+ rd.title = 'Overview'
10
10
  end
11
11
 
12
12
  spec = eval(File.read('overview.gemspec'))
data/bin/overview CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ #run via terminal e.g. bundle exec ./bin/overview appversion -a
2
3
  require 'gli'
3
- require 'overview'
4
+ require 'overview.rb'
4
5
 
5
6
  include GLI::App
6
- include Overview
7
7
 
8
8
  program_desc "Config management tool connecting Over's CI / CD toolchain"
9
9
 
@@ -12,15 +12,29 @@ version Overview::VERSION
12
12
  subcommand_option_handling :normal
13
13
  arguments :strict
14
14
 
15
+ =begin
15
16
  desc 'Describe some switch here'
16
17
  switch [:s,:switch]
18
+ =end
19
+ desc 'Sprint.ly API KEY'
20
+ #default_value 'the default'
21
+ arg_name 'API_KEY'
22
+ flag [:sprintly_api_key]
17
23
 
18
- desc 'Describe some flag here'
19
- default_value 'the default'
20
- arg_name 'The name of the argument'
21
- flag [:f,:flagname]
24
+ desc 'Sprint.ly USER'
25
+ arg_name 'USER'
26
+ flag [:sprintly_user]
22
27
 
23
- desc 'Describe deploy here'
28
+ desc 'Github token'
29
+ arg_name 'TOKEN'
30
+ flag [:travis_token]
31
+
32
+
33
+ desc 'Github token'
34
+ arg_name 'TOKEN'
35
+ flag [:github_token]
36
+
37
+ desc 'Mark Sprint.ly tickets as deployed via Github'
24
38
  arg_name 'Describe arguments to deploy here'
25
39
  command :deploy do |c|
26
40
  c.desc 'Describe a switch to deploy'
@@ -40,6 +54,19 @@ command :deploy do |c|
40
54
  end
41
55
  end
42
56
 
57
+ desc 'Mark Sprint.ly tickets as released via Github Releases'
58
+ arg_name 'Describe arguments to deploy here'
59
+ command :release do |c|
60
+ c.action do |global_options,options,args|
61
+
62
+ # Your command logic here
63
+
64
+ # If you have any errors, just raise them
65
+ # raise "that command made no sense"
66
+
67
+ puts "release command ran"
68
+ end
69
+ end
43
70
 
44
71
 
45
72
  desc 'Retrieve the changelog for the latest commit'
@@ -51,7 +78,8 @@ command :changelog do |c|
51
78
  c.default_value 'production'
52
79
  c.flag :a
53
80
  c.action do |global_options,options,args|
54
- puts "alphalog command ran"
81
+ include Changelog
82
+ Changelog::Log.new.display
55
83
  end
56
84
  end
57
85
 
@@ -64,27 +92,34 @@ command :appversion do |c|
64
92
  c.switch :b
65
93
  c.desc 'Version (no build) with branch e.g. 0.1.1-feature'
66
94
  c.switch :v
67
- c.desc 'Rubygem compatible version with build appended e.g. 0.1.1.534'
95
+ c.desc 'Rubygem compatible version with build appended e.g. 0.1.1-feature-534'
68
96
  c.switch :r
69
- c.desc 'Github token'
70
- c.flag :g
97
+ c.desc 'Google App Engine compatible version with build appended e.g. 0-1-1-feature-534'
98
+ c.switch :a
71
99
  c.action do |global_options,options,args|
72
- ENV['GITHUB_TOKEN'] = options[:g] unless options[:g].nil?
100
+ include AppVersion
73
101
  if options[:s]
74
- puts Overview::AppVersion.new.version(true).to_s
102
+ puts AppVersion::Version.new.version(true).to_s
75
103
  elsif options[:b]
76
- puts Overview::AppVersion.new.build_no.to_s
104
+ puts AppVersion::Version.new.build_no.to_s
77
105
  elsif options[:v]
78
- puts Overview::AppVersion.new.version.to_s
106
+ puts AppVersion::Version.new.version.to_s
79
107
  elsif options[:r]
80
- puts "#{Overview::AppVersion.new.version.to_s}.#{Overview::AppVersion.new.build_no.to_s}"
108
+ puts "#{AppVersion::Version.new.version.to_s}.#{AppVersion::Version.new.build_no.to_s}"
109
+ elsif options[:a]
110
+ puts "#{AppVersion::Version.new.version.to_s}.#{AppVersion::Version.new.build_no.to_s}".gsub('.','-')
81
111
  else
82
- puts Overview::AppVersion.new.to_s
112
+ puts AppVersion::Version.new.to_s
83
113
  end
84
114
  end
85
115
  end
86
116
 
87
117
  pre do |global,command,options,args|
118
+ ENV['GITHUB_TOKEN'] = global[:github_token] unless global[:github_token].nil?
119
+ ENV['TRAVIS_TOKEN'] = global[:travis_token] unless global[:travis_token].nil?
120
+ ENV['SPRINTLY_USER'] = global[:sprintly_user] unless global[:sprintly_user].nil?
121
+ ENV['SPRINTLY_API_KEY'] = global[:sprintly_api_key] unless global[:sprintly_api_key].nil?
122
+
88
123
  # Pre logic here
89
124
  # Return true to proceed; false to abort and not call the
90
125
  # chosen command
@@ -1,4 +1,4 @@
1
- module Overview
1
+ module AppVersion
2
2
 
3
3
  class Release
4
4
  def self.is_pre_release?(tag)
@@ -9,7 +9,7 @@ module Overview
9
9
  default
10
10
  else
11
11
  require 'octokit'
12
- repo = Git.repo
12
+ repo = CI.repo || Git.repo
13
13
  p "Repo slug is #{repo}."
14
14
  if repo.empty? || ENV['GITHUB_TOKEN'].nil? #for local builds
15
15
  p 'GITHUB_TOKEN missing, running locally.'
@@ -20,8 +20,11 @@ module Overview
20
20
  client.user.login
21
21
  client.default_media_type = "application/vnd.github.moondragon+json"
22
22
  release = client.release_for_tag(repo, tag)
23
- p 'Checking Github release status.'
24
- release[:prerelease]
23
+ if !release
24
+ default
25
+ else
26
+ release[:prerelease]
27
+ end
25
28
  end
26
29
  end
27
30
 
@@ -32,12 +35,13 @@ module Overview
32
35
  end
33
36
  end
34
37
 
35
- class AppVersion
38
+ class Version
36
39
 
37
40
  def to_s
38
41
  "#{version} (#{build_no})"
39
42
  end
40
43
 
44
+ #TODO: refactor so that every permutation can be tested. E.g. github release where is_pre_release=false, what is the commit count?
41
45
  def version(semantic = false)
42
46
  version_suffix = CI.version_suffix
43
47
  if Git.installed?
@@ -53,6 +57,7 @@ module Overview
53
57
  clean_tag = Git.clean_tag
54
58
  end
55
59
  #Only increment version after production release, so that we retain a single version during beta and RCs
60
+ #TODO: check if this is a tagged build, and then always use the clean_tag. Not need to check pre_release or increment
56
61
  if commit_count == 0 || Release.is_pre_release?(latest_tag)
57
62
  short_version = clean_tag
58
63
  else
@@ -76,7 +81,7 @@ module Overview
76
81
  end
77
82
 
78
83
  def suffix
79
- branch = Git.branch
84
+ branch = CI.branch || Git.branch
80
85
  p "Branch = #{branch}."
81
86
  case branch
82
87
  when /develop/