TeamCityLABS 1.0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 76ebc49300f57caf7e73475bb8682b775fd8ad0f
4
+ data.tar.gz: 46bf7a517f5782f8c1ac0f051757018372c2978e
5
+ SHA512:
6
+ metadata.gz: 1cd431349b812014091bdee25808db90e1fdb31af39219d208109a61154c7662f48e7f425c7d4f7857dc45a7227fce0266697731a092cf17597bfe56872fbb0f
7
+ data.tar.gz: a8eedd4d75f019fc96ce57453ee02fd0fd8ec6c38c5c9ec1b05b3c95d4e5024ed8390ea3bccbc587ec1db8ca8f0515fd48e398e6b7b98baa958559ac40e9bea0
@@ -0,0 +1,6 @@
1
+ api_url: "http://was21:8111/httpAuth/app/rest"
2
+ http_user: "trent.jones"
3
+ http_password: "October26th"
4
+ repositories:
5
+ template-data-id1: EcsV6_Git
6
+ template-data-id2: EcsV7_Git
data/jobs/teamcity.rb ADDED
@@ -0,0 +1,77 @@
1
+ require 'teamcity'
2
+
3
+ config_file = File.dirname(File.expand_path(__FILE__)) + '/../config/teamcity.yml'
4
+ config = YAML::load(File.open(config_file))
5
+
6
+ TeamCity.configure do |c|
7
+ c.endpoint = config['api_url']
8
+ c.http_user = config['http_user']
9
+ c.http_password = config['http_password']
10
+ end
11
+
12
+ SCHEDULER.every '60s', :first_in => '1s' do
13
+ if config['repositories'].nil?
14
+ puts 'No TeamCity repositories found :('
15
+ else
16
+ config['repositories'].each do |data_id, build_id|
17
+ send_event(data_id, { :items => update_builds(build_id)})
18
+ end
19
+ end
20
+ end
21
+
22
+ def update_builds(project_id)
23
+ builds = []
24
+ projects = Array.new
25
+
26
+ project = TeamCity.project(:id => project_id)
27
+ build_types = Array.new {Array.new}
28
+
29
+ TeamCity.project_buildtypes(:id => project['id']).each do |build_type|
30
+ build_types.push({
31
+ :id => build_type.id,
32
+ :name => build_type.name
33
+ })
34
+ end
35
+
36
+ build_types.each do |build_type|
37
+ build_type_builds = TeamCity.builds(:buildType => build_type[:id], :branch => 'default:any')
38
+ unless build_type_builds.nil?
39
+ latest_build = build_type_builds.first
40
+ max_build_number = latest_build.id
41
+ build_type_builds.each do |build|
42
+ if build.id > max_build_number
43
+ latest_build = build
44
+ end
45
+ end
46
+
47
+ uname = 'Unassigned'
48
+ if !TeamCity.build(:id => latest_build.id).lastChanges.nil?
49
+ uname = TeamCity.build(:id => latest_build.id).lastChanges.change.first['username']
50
+ end
51
+
52
+ build_type['last_build'] = {
53
+ :id => latest_build.id,
54
+ :number => latest_build.number,
55
+ :state => latest_build.state,
56
+ :status => latest_build.status,
57
+ :username => uname
58
+ }
59
+ end
60
+ end
61
+
62
+ projects.push({
63
+ :name => project.description,
64
+ :id => project.id,
65
+ :description => project.description,
66
+ :build_types => build_types
67
+ })
68
+
69
+ build_info = {
70
+ :title => project_id,
71
+ :projects => projects
72
+ }
73
+
74
+ builds << build_info
75
+
76
+ builds
77
+ end
@@ -0,0 +1,10 @@
1
+ class Dashing.TeamCity extends Dashing.Widget
2
+
3
+ onData: (data) ->
4
+ # clear existing "status-*" classes
5
+ $(@get('node')).attr 'class', (i,c) ->
6
+ c.replace /\bstatus-\S+/g, ''
7
+
8
+ if data.status
9
+ # add new class
10
+ $(@get('node')).addClass "status-#{data.status}"
@@ -0,0 +1,26 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <img data-bind-src="image | prepend '/assets'" data-bind-width="width"/>
4
+
5
+ <ul class="list-nostyle">
6
+ <li data-foreach-item="items">
7
+ <ul>
8
+ <li class="project" data-foreach-item="item.projects">
9
+ <h3 class="project-name" data-bind="item.name"></h3>
10
+ <ul class="builds">
11
+ <li data-foreach-item="item.build_types"
12
+ data-bind-class="item.last_build.status">
13
+ <p>
14
+ <strong class="build-type-name" data-bind="item.name"></strong><br>
15
+ #<span data-bind="item.last_build.number"></span><br>
16
+ - <span class="build-type-name" data-bind="item.last_build.username"></span>
17
+ </p>
18
+ </li>
19
+ </ul>
20
+ </li>
21
+ </ul>
22
+ </li>
23
+ </ul>
24
+
25
+ <p class="more-info" data-bind="moreinfo"></p>
26
+ <p class="updated-at" data-bind="updatedAtMessage"></p>
@@ -0,0 +1,130 @@
1
+ // ----------
2
+ // Sass declarations
3
+ // ----------
4
+ $value-color: #FFF;
5
+ $background-error-color: #E64040;
6
+ $background-passed-color: rgba(111, 214, 85, 0.66);
7
+ $background-investigation-color: #E64040;
8
+ $background-started-color: #E7D100;
9
+ $background-no-status-color: rgba(115, 115, 115, 0.73);
10
+
11
+ $title-color: rgba(255, 255, 255, 1);
12
+ $label-color: rgba(255, 255, 255, 0.7);
13
+ $moreinfo-color: rgba(255, 255, 255, 0.7);
14
+ $background: #444;
15
+
16
+ @mixin keyframes($animation-name) {
17
+ @-webkit-keyframes #{$animation-name} {
18
+ @content;
19
+ }
20
+ @-moz-keyframes #{$animation-name} {
21
+ @content;
22
+ }
23
+ @-ms-keyframes #{$animation-name} {
24
+ @content;
25
+ }
26
+ @-o-keyframes #{$animation-name} {
27
+ @content;
28
+ }
29
+ @keyframes #{$animation-name} {
30
+ @content;
31
+ }
32
+ }
33
+
34
+ @mixin animation($args...) {
35
+ -webkit-animation: $args;
36
+ -moz-animation: $args;
37
+ -ms-animation: $args;
38
+ -o-animation: $args;
39
+ animation: $args;
40
+ }
41
+
42
+ @include keyframes(blink) {
43
+ 0% { opacity: 1.0; }
44
+ 50% { opacity: 0.0; }
45
+ 100% { opacity: 1.0; }
46
+ }
47
+
48
+ // ----------------------------------------------------------------------------
49
+ // Widget-list styles
50
+ // ----------------------------------------------------------------------------
51
+ .widget-team-city{
52
+ background-color: $background;
53
+ vertical-align: top !important;
54
+
55
+ h1{
56
+ text-transform: none;
57
+ }
58
+ h3{
59
+ font-size: 15px;
60
+ margin: 5px 0;
61
+ font-weight: lighter;
62
+ }
63
+
64
+ img {
65
+ position: absolute;
66
+ top: 30px;
67
+ left: 50px;
68
+ margin: 0 auto;
69
+ opacity: 0.05;
70
+ max-width: 80%;
71
+ max-height: 80%;
72
+ }
73
+
74
+ .title, strong{
75
+ color: $title-color;
76
+ }
77
+
78
+ ul {
79
+ margin: 0;
80
+ text-align: left;
81
+ list-style: none;
82
+ color: $label-color;
83
+ }
84
+
85
+ li {
86
+ margin-bottom: 3px;
87
+ }
88
+
89
+ .project{
90
+ .project-name{
91
+ padding-top: 5px;
92
+ }
93
+ }
94
+ .builds{
95
+ p{
96
+ padding: 8px;
97
+ }
98
+ li{
99
+ background-color: $background-no-status-color;
100
+ font-size: 15px;
101
+ }
102
+ margin-bottom: 5px;
103
+ .SUCCESS{
104
+ background-color: $background-passed-color;
105
+ }
106
+ .FAILURE{
107
+ background-color: $background-error-color;
108
+ @include animation(blink 1s step-start 0s infinite);
109
+ }
110
+ .INVESTIGATION{
111
+ span:before{
112
+ content: "\f06e";
113
+ font-family: FontAwesome;
114
+ padding-right: 3px;
115
+ }
116
+ background-color: $background-investigation-color;
117
+ }
118
+ .build-type-name{
119
+ font-size: 17px;
120
+ }
121
+ }
122
+
123
+ .updated-at {
124
+ color: rgba(0, 0, 0, 0.3);
125
+ }
126
+
127
+ .more-info {
128
+ color: $moreinfo-color;
129
+ }
130
+ }
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: TeamCityLABS
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Trent Jones
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-31 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A Dashing Widget to display the latest build status of all builds within
14
+ a project.
15
+ email: trent.william.jones@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - config/teamcity.yml
21
+ - jobs/teamcity.rb
22
+ - widgets/team_city/team_city.coffee
23
+ - widgets/team_city/team_city.html
24
+ - widgets/team_city/team_city.scss
25
+ homepage: http://rubygems.org/gems/TeamCityLABS
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 2.4.5.1
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: TeamCity Latest Build Status
49
+ test_files: []