Commit 6afd69f4 authored by Douwe Maan's avatar Douwe Maan

Update gitignore, change literal DB table names, fix errors, fix fontawesome

parent 046b2831
...@@ -20,12 +20,14 @@ backups/* ...@@ -20,12 +20,14 @@ backups/*
config/aws.yml config/aws.yml
config/database.yml config/database.yml
config/gitlab.yml config/gitlab.yml
config/gitlab_ci.yml
config/initializers/omniauth.rb config/initializers/omniauth.rb
config/initializers/rack_attack.rb config/initializers/rack_attack.rb
config/initializers/smtp_settings.rb config/initializers/smtp_settings.rb
config/resque.yml config/resque.yml
config/unicorn.rb config/unicorn.rb
config/mail_room.yml config/mail_room.yml
config/secrets.yml
coverage/* coverage/*
db/*.sqlite3 db/*.sqlite3
db/*.sqlite3-journal db/*.sqlite3-journal
...@@ -41,3 +43,4 @@ rails_best_practices_output.html ...@@ -41,3 +43,4 @@ rails_best_practices_output.html
/tags /tags
tmp/ tmp/
vendor/bundle/* vendor/bundle/*
/ci/builds/*
...@@ -41,7 +41,7 @@ $(document).on 'click', '.edit-runner-link', (event) -> ...@@ -41,7 +41,7 @@ $(document).on 'click', '.edit-runner-link', (event) ->
descr.removeClass('hide') descr.removeClass('hide')
$(document).on 'click', '.assign-all-runner', -> $(document).on 'click', '.assign-all-runner', ->
$(this).replaceWith('<i class="fa-refresh fa-spin"></i> Assign in progress..') $(this).replaceWith('<i class="fa fa-refresh fa-spin"></i> Assign in progress..')
window.unbindEvents = -> window.unbindEvents = ->
$(document).unbind('scroll') $(document).unbind('scroll')
......
...@@ -29,7 +29,7 @@ class CiBuild ...@@ -29,7 +29,7 @@ class CiBuild
success: (build) => success: (build) =>
if build.status == "running" if build.status == "running"
$('#build-trace code').html build.trace_html $('#build-trace code').html build.trace_html
$('#build-trace code').append '<i class="fa-refresh fa-spin"/>' $('#build-trace code').append '<i class="fa fa-refresh fa-spin"/>'
@checkAutoscroll() @checkAutoscroll()
else else
Turbolinks.visit build_url Turbolinks.visit build_url
......
...@@ -122,7 +122,7 @@ ul.bordered-list { ...@@ -122,7 +122,7 @@ ul.bordered-list {
color: #888; color: #888;
text-shadow: 0 1px 1px #fff; text-shadow: 0 1px 1px #fff;
} }
i[class^="fa-"] { i.fa {
line-height: 14px; line-height: 14px;
} }
} }
......
...@@ -11,7 +11,7 @@ module Ci ...@@ -11,7 +11,7 @@ module Ci
def index def index
@runners = @project.runners.order('id DESC') @runners = @project.runners.order('id DESC')
@specific_runners = current_user.authorized_runners. @specific_runners = current_user.authorized_runners.
where.not(id: @runners).order('runners.id DESC').page(params[:page]).per(20) where.not(id: @runners).order("#{Ci::Runner.table_name}.id DESC").page(params[:page]).per(20)
@shared_runners = Ci::Runner.shared.active @shared_runners = Ci::Runner.shared.active
@shared_runners_count = @shared_runners.count(:all) @shared_runners_count = @shared_runners.count(:all)
end end
......
...@@ -2,9 +2,9 @@ module Ci ...@@ -2,9 +2,9 @@ module Ci
module IconsHelper module IconsHelper
def boolean_to_icon(value) def boolean_to_icon(value)
if value.to_s == "true" if value.to_s == "true"
content_tag :i, nil, class: 'fa-circle cgreen' content_tag :i, nil, class: 'fa fa-circle cgreen'
else else
content_tag :i, nil, class: 'fa-power-off clgray' content_tag :i, nil, class: 'fa fa-power-off clgray'
end end
end end
end end
......
...@@ -3,7 +3,7 @@ module Ci ...@@ -3,7 +3,7 @@ module Ci
def runner_status_icon(runner) def runner_status_icon(runner)
unless runner.contacted_at unless runner.contacted_at
return content_tag :i, nil, return content_tag :i, nil,
class: "fa-warning-sign", class: "fa fa-warning-sign",
title: "New runner. Has not connected yet" title: "New runner. Has not connected yet"
end end
...@@ -15,7 +15,7 @@ module Ci ...@@ -15,7 +15,7 @@ module Ci
end end
content_tag :i, nil, content_tag :i, nil,
class: "fa-circle runner-status-#{status}", class: "fa fa-circle runner-status-#{status}",
title: "Runner is #{status}, last contact was #{time_ago_in_words(runner.contacted_at)} ago" title: "Runner is #{status}, last contact was #{time_ago_in_words(runner.contacted_at)} ago"
end end
end end
......
...@@ -68,7 +68,7 @@ module Ci ...@@ -68,7 +68,7 @@ module Ci
def authorized_runners def authorized_runners
Ci::Runner.specific.includes(:runner_projects). Ci::Runner.specific.includes(:runner_projects).
where(runner_projects: { project_id: authorized_projects } ) where(Ci::RunnerProject.table_name => { project_id: authorized_projects } )
end end
def authorized_projects def authorized_projects
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%td %td
= project.id = project.id
%td %td
= link_to project do = link_to [:ci, project] do
%strong= project.name %strong= project.name
%td %td
- if last_commit - if last_commit
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
No builds yet No builds yet
%td %td
- if project.public - if project.public
%i.fa-globe %i.fa.fa-globe
Public Public
- else - else
%i.fa-lock %i.fa.fa-lock
Private Private
%td %td
= project.commits.count = project.commits.count
%td %td
= link_to [:ci, :admin, project], method: :delete, class: 'btn btn-danger btn-sm' do = link_to [:ci, :admin, project], method: :delete, class: 'btn btn-danger btn-sm' do
%i.fa-remove %i.fa.fa-remove
Remove Remove
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
.pull-right .pull-right
- if build.active? - if build.active?
= link_to cancel_ci_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do = link_to cancel_ci_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do
%i.fa-remove.cred %i.fa.fa-remove.cred
- elsif build.commands.present? - elsif build.commands.present?
= link_to retry_ci_project_build_path(build.project, build, return_to: request.original_url), method: :post, title: 'Retry build' do = link_to retry_ci_project_build_path(build.project, build, return_to: request.original_url), method: :post, title: 'Retry build' do
%i.fa-repeat %i.fa.fa-repeat
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
%a %a
Build ##{@build.id} Build ##{@build.id}
&middot; &middot;
%i.fa-warning-sign %i.fa.fa-warning-sign
This build was retried. This build was retried.
.row .row
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
- if @build.duration - if @build.duration
.pull-right .pull-right
%span %span
%i.fa-time %i.fa.fa-time
#{duration_in_words(@build.finished_at, @build.started_at)} #{duration_in_words(@build.finished_at, @build.started_at)}
.clearfix .clearfix
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
.clearfix .clearfix
.scroll-controls .scroll-controls
= link_to '#up-build-trace', class: 'btn' do = link_to '#up-build-trace', class: 'btn' do
%i.fa-angle-up %i.fa.fa-angle-up
= link_to '#down-build-trace', class: 'btn' do = link_to '#down-build-trace', class: 'btn' do
%i.fa-angle-down %i.fa.fa-angle-down
%pre.trace#build-trace %pre.trace#build-trace
%code.bash %code.bash
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
Builds Builds
- if @commit.duration > 0 - if @commit.duration > 0
%small.pull-right %small.pull-right
%i.fa-time %i.fa.fa-time
#{time_interval_in_words @commit.duration} #{time_interval_in_words @commit.duration}
%table.builds %table.builds
......
...@@ -14,27 +14,27 @@ ...@@ -14,27 +14,27 @@
.bs-callout.bs-callout-success .bs-callout.bs-callout-success
%h4 %h4
= link_to 'https://gitlab.com/gitlab-org/gitlab-ci/blob/master/doc/api' do = link_to 'https://gitlab.com/gitlab-org/gitlab-ci/blob/master/doc/api' do
%i.fa-cogs %i.fa.fa-cogs
API API
%p Explore how you can access GitLab CI via the API. %p Explore how you can access GitLab CI via the API.
.bs-callout.bs-callout-info .bs-callout.bs-callout-info
%h4 %h4
= link_to 'https://gitlab.com/gitlab-org/gitlab-ci/tree/master/doc/examples' do = link_to 'https://gitlab.com/gitlab-org/gitlab-ci/tree/master/doc/examples' do
%i.fa-info-sign %i.fa.fa-info-sign
Build script examples Build script examples
%p This includes the build script we use to test GitLab CE. %p This includes the build script we use to test GitLab CE.
.bs-callout.bs-callout-danger .bs-callout.bs-callout-danger
%h4 %h4
= link_to 'https://gitlab.com/gitlab-org/gitlab-ci/issues' do = link_to 'https://gitlab.com/gitlab-org/gitlab-ci/issues' do
%i.fa-bug %i.fa.fa-bug
Issue tracker Issue tracker
%p Reports about recent bugs and problems.. %p Reports about recent bugs and problems..
.bs-callout.bs-callout-warning .bs-callout.bs-callout-warning
%h4 %h4
= link_to 'http://feedback.gitlab.com/forums/176466-general/category/64310-gitlab-ci' do = link_to 'http://feedback.gitlab.com/forums/176466-general/category/64310-gitlab-ci' do
%i.fa-thumbs-up %i.fa.fa-thumbs-up
Feedback forum Feedback forum
%p Suggest improvements or new features for GitLab CI. %p Suggest improvements or new features for GitLab CI.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
%p %p
%b Status: %b Status:
syntax is correct syntax is correct
%i.fa-ok.correct-syntax %i.fa.fa-ok.correct-syntax
%table.table.table-bordered %table.table.table-bordered
%thead %thead
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
%p %p
%b Status: %b Status:
syntax is incorrect syntax is incorrect
%i.fa-remove.incorrect-syntax %i.fa.fa-remove.incorrect-syntax
%b Error: %b Error:
= @error = @error
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
%p.text-center.loading %p.text-center.loading
%i.fa-refresh.fa-spin %i.fa.fa-refresh.fa-spin
.results.prepend-top-20 .results.prepend-top-20
......
- last_commit = project.last_commit - last_commit = project.last_commit
%tr.alert{class: commit_status_alert_class(last_commit) } %tr.alert{class: commit_status_alert_class(last_commit) }
%td %td
= link_to project do = link_to [:ci, project] do
%strong= project.name %strong= project.name
%td %td
- if last_commit - if last_commit
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
No builds yet No builds yet
%td %td
- if project.public - if project.public
%i.fa-globe %i.fa.fa-globe
Public Public
- else - else
%i.fa-lock %i.fa.fa-lock
Private Private
%td %td
= project.commits.count = project.commits.count
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.input-group .input-group
= search_field_tag "search", params[:search], placeholder: "Search", class: "search-input form-control" = search_field_tag "search", params[:search], placeholder: "Search", class: "search-input form-control"
.input-group-addon .input-group-addon
%i.fa-search %i.fa.fa-search
:coffeescript :coffeescript
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
by keyword: "#{params[:search]}", by keyword: "#{params[:search]}",
#{time_ago_in_words(current_user.sync_at)} ago. #{time_ago_in_words(current_user.sync_at)} ago.
= link_to gitlab_ci_projects_path(reset_cache: true, search: params[:search]), class: 'sync-now btn btn-sm btn-default reset-cache' do = link_to gitlab_ci_projects_path(reset_cache: true, search: params[:search]), class: 'sync-now btn btn-sm btn-default reset-cache' do
%i.fa-refresh %i.fa.fa-refresh
Sync now Sync now
%br %br
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
= render "gl_projects" = render "gl_projects"
%p.text-center.hide.loading %p.text-center.hide.loading
%i.fa-refresh.fa-spin %i.fa.fa-refresh.fa-spin
- else - else
= render @projects = render @projects
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.projects .projects
%p.fetch-status.light %p.fetch-status.light
%i.fa-refresh.fa-spin %i.fa.fa-refresh.fa-spin
Please wait while we fetch from GitLab (#{GitlabCi.config.gitlab_server.url}) Please wait while we fetch from GitLab (#{GitlabCi.config.gitlab_server.url})
:coffeescript :coffeescript
$.get '#{gitlab_ci_projects_path}', (data) -> $.get '#{gitlab_ci_projects_path}', (data) ->
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.navbar-header .navbar-header
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"} %button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
%span.sr-only Toggle navigation %span.sr-only Toggle navigation
%i.fa-reorder %i.fa.fa-reorder
= link_to 'GitLab CI', ci_root_path, class: "navbar-brand" = link_to 'GitLab CI', ci_root_path, class: "navbar-brand"
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
%span= current_user.name %span= current_user.name
%li %li
= link_to ci_user_sessions_path, class: "logout", method: :delete do = link_to ci_user_sessions_path, class: "logout", method: :delete do
%i.fa-signout %i.fa.fa-signout
Logout Logout
- else - else
%li %li
......
%ul.nav.nav-pills.nav-stacked.admin-menu %ul.nav.nav-pills.nav-stacked.admin-menu
= nav_link path: 'projects' do = nav_link path: 'projects' do
= link_to ci_admin_projects_path do = link_to ci_admin_projects_path do
%i.fa-list-alt %i.fa.fa-list-alt
Projects Projects
= nav_link path: 'events' do = nav_link path: 'events' do
= link_to ci_admin_events_path do = link_to ci_admin_events_path do
%i.fa-book %i.fa.fa-book
Events Events
= nav_link path: 'runners#index' do = nav_link path: 'runners#index' do
= link_to ci_admin_runners_path do = link_to ci_admin_runners_path do
%i.fa-cog %i.fa.fa-cog
Runners Runners
%small.pull-right %small.pull-right
= Ci::Runner.count(:all) = Ci::Runner.count(:all)
= nav_link path: 'builds' do = nav_link path: 'builds' do
= link_to ci_admin_builds_path do = link_to ci_admin_builds_path do
%i.fa-link %i.fa.fa-link
Builds Builds
%small.pull-right %small.pull-right
= Ci::Build.count(:all) = Ci::Build.count(:all)
...@@ -23,6 +23,6 @@ ...@@ -23,6 +23,6 @@
%hr %hr
= nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do
= link_to ci_admin_application_settings_path do = link_to ci_admin_application_settings_path do
%i.fa-cogs %i.fa.fa-cogs
%span %span
Settings Settings
%ul.nav.nav-pills.nav-stacked.project-menu %ul.nav.nav-pills.nav-stacked.project-menu
= nav_link path: 'projects#show' do = nav_link path: 'projects#show' do
= link_to ci_project_path(@project) do = link_to ci_project_path(@project) do
%i.fa-list-alt %i.fa.fa-list-alt
Commits Commits
%small.pull-right= @project.commits.count %small.pull-right= @project.commits.count
= nav_link path: 'charts#show' do = nav_link path: 'charts#show' do
= link_to ci_project_charts_path(@project) do = link_to ci_project_charts_path(@project) do
%i.fa-bar-chart %i.fa.fa-bar-chart
Charts Charts
= nav_link path: ['runners#index', 'runners#show'] do = nav_link path: ['runners#index', 'runners#show'] do
= link_to ci_project_runners_path(@project) do = link_to ci_project_runners_path(@project) do
%i.fa-cog %i.fa.fa-cog
Runners Runners
= nav_link path: 'variables#index' do = nav_link path: 'variables#show' do
= link_to ci_project_variables_path(@project) do = link_to ci_project_variables_path(@project) do
%i.fa-code %i.fa.fa-code
Variables Variables
= nav_link path: 'web_hooks#index' do = nav_link path: 'web_hooks#index' do
= link_to ci_project_web_hooks_path(@project) do = link_to ci_project_web_hooks_path(@project) do
%i.fa-link %i.fa.fa-link
Web Hooks Web Hooks
= nav_link path: 'triggers#index' do = nav_link path: 'triggers#index' do
= link_to ci_project_triggers_path(@project) do = link_to ci_project_triggers_path(@project) do
%i.fa-retweet %i.fa.fa-retweet
Triggers Triggers
= nav_link path: 'services#index' do = nav_link path: 'services#index' do
= link_to ci_project_services_path(@project) do = link_to ci_project_services_path(@project) do
%i.fa-share %i.fa.fa-share
Services Services
= nav_link path: 'events#index' do = nav_link path: 'events#index' do
= link_to ci_project_events_path(@project) do = link_to ci_project_events_path(@project) do
%i.fa-book %i.fa.fa-book
Events Events
%li %li
%hr %hr
= nav_link path: 'projects#edit' do = nav_link path: 'projects#edit' do
= link_to edit_ci_project_path(@project) do = link_to edit_ci_project_path(@project) do
%i.fa-cogs %i.fa.fa-cogs
Settings Settings
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= @project.name = @project.name
- if @project.public - if @project.public
%small %small
%i.fa-globe %i.fa.fa-globe
Public Public
.pull-right .pull-right
......
development:
gitlab_server:
url: 'http://gitlab.dev'
app_id: 'cfda7ec2551af42d06acc6dbda9087dbdc8d45b7e2bc240f498fad3f84ff4044'
app_secret: 'd1802d55db9c1aedc950812a9489e2659fa1430dc488babde949bc9c409cc01b'
gitlab_ci:
host: 'http://ci.gitlab.dev'
port: 80
https: false
test:
gitlab_server:
url: 'http://demo.gitlab.com/'
app_id: ''
app_secret: ''
gitlab_ci:
host: localhost
port: 80
https: false
---
development:
db_key_base: 53ab5c413f37a5a87df3c7e55dc49924793c44b9a40834af258f75ce3cc71067478b7c1f999bf22d9cfb9e6dedffda989dc462684f8c869705f735a92b7230ed
...@@ -17,10 +17,10 @@ module Ci ...@@ -17,10 +17,10 @@ module Ci
def push(from, to, format) def push(from, to, format)
@labels << from.strftime(format) @labels << from.strftime(format)
@total << project.builds. @total << project.builds.
where('? > builds.created_at AND builds.created_at > ?', to, from). where("? > #{Ci::Build.table_name}.created_at AND #{Ci::Build.table_name}.created_at > ?", to, from).
count(:all) count(:all)
@success << project.builds. @success << project.builds.
where('? > builds.created_at AND builds.created_at > ?', to, from). where("? > #{Ci::Build.table_name}.created_at AND #{Ci::Build.table_name}.created_at > ?", to, from).
success.count(:all) success.count(:all)
end end
end end
...@@ -60,7 +60,7 @@ module Ci ...@@ -60,7 +60,7 @@ module Ci
class BuildTime < Chart class BuildTime < Chart
def collect def collect
commits = project.commits.joins(:builds).where('builds.finished_at is NOT NULL AND builds.started_at is NOT NULL').last(30) commits = project.commits.joins(:builds).where("#{Ci::Build.table_name}.finished_at is NOT NULL AND #{Ci::Build.table_name}.started_at is NOT NULL").last(30)
commits.each do |commit| commits.each do |commit|
@labels << commit.short_sha @labels << commit.short_sha
@build_times << (commit.duration / 60) @build_times << (commit.duration / 60)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment