shipit-engine 0.20.1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +43 -6
- data/app/assets/stylesheets/_base/_base.scss +4 -0
- data/app/assets/stylesheets/_pages/_commits.scss +3 -1
- data/app/assets/stylesheets/_pages/_deploy.scss +4 -2
- data/app/controllers/concerns/shipit/authentication.rb +1 -1
- data/app/controllers/shipit/api/base_controller.rb +6 -1
- data/app/controllers/shipit/api/pull_requests_controller.rb +1 -1
- data/app/controllers/shipit/commit_checks_controller.rb +1 -1
- data/app/controllers/shipit/shipit_controller.rb +1 -5
- data/app/controllers/shipit/stacks_controller.rb +2 -0
- data/app/controllers/shipit/tasks_controller.rb +1 -1
- data/app/controllers/shipit/webhooks_controller.rb +2 -2
- data/app/helpers/shipit/deploys_helper.rb +9 -0
- data/app/helpers/shipit/shipit_helper.rb +17 -15
- data/app/helpers/shipit/stacks_helper.rb +6 -1
- data/app/jobs/shipit/destroy_stack_job.rb +4 -2
- data/app/jobs/shipit/fetch_deployed_revision_job.rb +1 -1
- data/app/jobs/shipit/github_sync_job.rb +1 -1
- data/app/jobs/shipit/merge_pull_requests_job.rb +3 -3
- data/app/jobs/shipit/perform_task_job.rb +3 -0
- data/app/jobs/shipit/purge_old_deliveries_job.rb +1 -0
- data/app/models/shipit/api_client.rb +1 -1
- data/app/models/shipit/commit.rb +29 -6
- data/app/models/shipit/commit_deployment.rb +1 -1
- data/app/models/shipit/commit_deployment_status.rb +1 -1
- data/app/models/shipit/deploy_spec.rb +19 -2
- data/app/models/shipit/deploy_spec/bundler_discovery.rb +1 -10
- data/app/models/shipit/deploy_spec/file_system.rb +6 -0
- data/app/models/shipit/deploy_spec/kubernetes_discovery.rb +1 -1
- data/app/models/shipit/deploy_spec/lerna_discovery.rb +85 -0
- data/app/models/shipit/deploy_spec/npm_discovery.rb +103 -5
- data/app/models/shipit/deploy_spec/pypi_discovery.rb +4 -2
- data/app/models/shipit/deploy_spec/rubygems_discovery.rb +4 -2
- data/app/models/shipit/duration.rb +1 -1
- data/app/models/shipit/github_status.rb +1 -1
- data/app/models/shipit/hook.rb +4 -5
- data/app/models/shipit/output_chunk.rb +1 -1
- data/app/models/shipit/pull_request.rb +36 -15
- data/app/models/shipit/stack.rb +15 -9
- data/app/models/shipit/status/common.rb +4 -0
- data/app/models/shipit/status/group.rb +4 -0
- data/app/models/shipit/task.rb +20 -8
- data/app/models/shipit/task_definition.rb +2 -2
- data/app/models/shipit/undeployed_commit.rb +13 -2
- data/app/models/shipit/user.rb +1 -1
- data/app/serializers/shipit/pull_request_serializer.rb +1 -1
- data/app/serializers/shipit/tail_task_serializer.rb +1 -1
- data/app/views/shipit/ccmenu/project.xml.builder +9 -8
- data/app/views/shipit/deploys/_deploy.html.erb +3 -2
- data/app/views/shipit/stacks/_banners.html.erb +4 -1
- data/app/views/shipit/stacks/settings.html.erb +4 -0
- data/app/views/shipit/statuses/_group.html.erb +1 -1
- data/app/views/shipit/statuses/_status.html.erb +1 -1
- data/app/views/shipit/tasks/_task.html.erb +1 -2
- data/config/locales/en.yml +2 -0
- data/config/secrets.development.example.yml +0 -4
- data/config/secrets.development.shopify.yml +1 -5
- data/db/migrate/20170904103242_reindex_deliveries.rb +7 -0
- data/db/migrate/20171120161420_add_base_info_to_pull_request.rb +7 -0
- data/db/migrate/20180202220850_add_aborted_by_to_tasks.rb +5 -0
- data/lib/shipit.rb +15 -23
- data/lib/shipit/command.rb +11 -3
- data/lib/shipit/engine.rb +0 -4
- data/lib/shipit/stack_commands.rb +3 -1
- data/lib/shipit/version.rb +1 -1
- data/lib/snippets/assert-lerna-fixed-version-tag +21 -0
- data/lib/snippets/assert-lerna-independent-version-tags +28 -0
- data/lib/snippets/generate-local-npmrc +19 -0
- data/lib/snippets/misconfigured-npm-publish-config +8 -0
- data/lib/snippets/publish-lerna-independent-packages +39 -0
- data/lib/snippets/push-to-heroku +5 -5
- data/lib/tasks/cron.rake +1 -1
- data/lib/tasks/dev.rake +1 -1
- data/test/controllers/api/deploys_controller_test.rb +19 -0
- data/test/controllers/api/stacks_controller_test.rb +1 -1
- data/test/controllers/github_authentication_controller_test.rb +1 -1
- data/test/controllers/stacks_controller_test.rb +10 -0
- data/test/controllers/tasks_controller_test.rb +2 -0
- data/test/controllers/webhooks_controller_test.rb +0 -7
- data/test/dummy/config/secrets.yml +0 -2
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +5 -3
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/fixtures/shipit/commits.yml +53 -0
- data/test/fixtures/shipit/pull_requests.yml +52 -0
- data/test/fixtures/shipit/stacks.yml +35 -0
- data/test/fixtures/shipit/statuses.yml +27 -0
- data/test/fixtures/shipit/tasks.yml +14 -0
- data/test/helpers/queries_helper.rb +1 -1
- data/test/jobs/merge_pull_requests_job_test.rb +19 -2
- data/test/jobs/perform_task_job_test.rb +26 -2
- data/test/models/commits_test.rb +55 -6
- data/test/models/deploy_spec_test.rb +288 -52
- data/test/models/deploys_test.rb +7 -7
- data/test/models/hook_test.rb +4 -3
- data/test/models/pull_request_test.rb +78 -24
- data/test/models/stacks_test.rb +21 -17
- data/test/models/status/group_test.rb +6 -0
- data/test/models/undeployed_commits_test.rb +9 -0
- data/test/models/users_test.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +211 -222
- data/app/assets/javascripts/shipit_bs.js.coffee +0 -2
- data/app/assets/stylesheets/shipit_bs.scss +0 -22
- data/app/views/bootstrap/shipit/missing_settings.html.erb +0 -97
- data/app/views/bootstrap/shipit/stacks/new.html.erb +0 -44
- data/app/views/layouts/shipit_bootstrap.html.erb +0 -44
- data/lib/shipit/template_renderer_extension.rb +0 -16
@@ -1,22 +0,0 @@
|
|
1
|
-
// Custom bootstrap variables must be set or import before bootstrap itself.
|
2
|
-
@import "bootstrap";
|
3
|
-
|
4
|
-
body {
|
5
|
-
padding-top: 5rem;
|
6
|
-
}
|
7
|
-
|
8
|
-
.navbar-brand {
|
9
|
-
background: asset-data-url('anchor.svg') center center no-repeat;
|
10
|
-
display: block;
|
11
|
-
width: 40px;
|
12
|
-
height: 40px;
|
13
|
-
transition: transform .3s ease-in-out;
|
14
|
-
text-indent: -9999px;
|
15
|
-
top: 50%;
|
16
|
-
right: 100%;
|
17
|
-
margin-right: 1em;
|
18
|
-
|
19
|
-
&:hover {
|
20
|
-
transform: rotate(-25deg);
|
21
|
-
}
|
22
|
-
}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
<% content_for :page_title do %>
|
2
|
-
Shipit
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<div class="jumbotron bg-warning">
|
6
|
-
<div class="container">
|
7
|
-
<h1 class="display-4">Oops! You're not ready to ship just yet.</h1>
|
8
|
-
<p class="lead">
|
9
|
-
Shipit is missing some of the information it needs to work properly.
|
10
|
-
Once you've added the configuration, make sure you restart the Rails server.
|
11
|
-
</p>
|
12
|
-
</div>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<div class="container">
|
16
|
-
<section>
|
17
|
-
<header>
|
18
|
-
<h2>GitHub application</h2>
|
19
|
-
</header>
|
20
|
-
|
21
|
-
<% if Shipit.github_oauth_id.blank? || Shipit.github_oauth_secret.blank? %>
|
22
|
-
<p><%= missing_github_oauth_message %></p>
|
23
|
-
<% end %>
|
24
|
-
<p id="github_oauth_id">
|
25
|
-
ID:
|
26
|
-
<% if Shipit.github_oauth_id.present? %>
|
27
|
-
Success!
|
28
|
-
<% else %>
|
29
|
-
<span class="missing">
|
30
|
-
<%= missing_github_oauth_id_message %>
|
31
|
-
</span>
|
32
|
-
<% end %>
|
33
|
-
</p>
|
34
|
-
|
35
|
-
<p id="github_oauth_secret">
|
36
|
-
Secret:
|
37
|
-
<% if Shipit.github_oauth_secret.present? %>
|
38
|
-
Success!
|
39
|
-
<% else %>
|
40
|
-
<span class="missing">
|
41
|
-
<%= missing_github_oauth_secret_message %>
|
42
|
-
</span>
|
43
|
-
<% end %>
|
44
|
-
</p>
|
45
|
-
</section>
|
46
|
-
|
47
|
-
<section>
|
48
|
-
<header>
|
49
|
-
<h2>GitHub API</h2>
|
50
|
-
</header>
|
51
|
-
|
52
|
-
<p id="github_api">
|
53
|
-
Token:
|
54
|
-
<% if Shipit.github_api_credentials.present? %>
|
55
|
-
Success!
|
56
|
-
<% else %>
|
57
|
-
<span class="missing">
|
58
|
-
<%= missing_github_api_credentials_message %>
|
59
|
-
</span>
|
60
|
-
<% end %>
|
61
|
-
</p>
|
62
|
-
</section>
|
63
|
-
|
64
|
-
<section>
|
65
|
-
<header>
|
66
|
-
<h2>Redis</h2>
|
67
|
-
</header>
|
68
|
-
|
69
|
-
<p id="redis_url">
|
70
|
-
Redis:
|
71
|
-
<% if Shipit.redis_url.present? %>
|
72
|
-
Success!
|
73
|
-
<% else %>
|
74
|
-
<span class="missing">
|
75
|
-
<%= missing_redis_url_message %>
|
76
|
-
</span>
|
77
|
-
<% end %>
|
78
|
-
</p>
|
79
|
-
</section>
|
80
|
-
|
81
|
-
<section>
|
82
|
-
<header>
|
83
|
-
<h2>Host</h2>
|
84
|
-
</header>
|
85
|
-
|
86
|
-
<p id="host">
|
87
|
-
Host:
|
88
|
-
<% if Shipit.host.present? %>
|
89
|
-
Success!
|
90
|
-
<% else %>
|
91
|
-
<span class="missing">
|
92
|
-
<%= missing_host_message %>
|
93
|
-
</span>
|
94
|
-
<% end %>
|
95
|
-
</p>
|
96
|
-
</section>
|
97
|
-
</div>
|
@@ -1,44 +0,0 @@
|
|
1
|
-
<% content_for :page_title do %>
|
2
|
-
Create a stack
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<div class='container'>
|
6
|
-
<section>
|
7
|
-
<header>
|
8
|
-
<h1>Create a stack</h1>
|
9
|
-
</header>
|
10
|
-
<%= form_for @stack do |f| %>
|
11
|
-
<fieldset class='form-group'>
|
12
|
-
<%= label_tag :stack_repo_owner, 'Repo' %>
|
13
|
-
<div class='input-group'>
|
14
|
-
<div class='input-group-addon'><%= Shipit.github_url %>/</div>
|
15
|
-
<%= f.text_field :repo_owner, placeholder: 'e.g. Shopify', required: true, class: 'form-control' %>
|
16
|
-
<div class='input-group-addon'>/</div>
|
17
|
-
<%= f.text_field :repo_name, placeholder: 'e.g. shipit-engine', required: true, pattern: "^[a-zA-Z0-9\-_\.]+$", class: 'form-control' %>
|
18
|
-
</div>
|
19
|
-
</fieldset>
|
20
|
-
<fieldset class='form-group'>
|
21
|
-
<%= f.label :branch %>
|
22
|
-
<%= f.text_field :branch, placeholder: 'master', class: 'form-control' %>
|
23
|
-
</fieldset>
|
24
|
-
<fieldset class='form-group'>
|
25
|
-
<%= f.label :environment %>
|
26
|
-
<%= f.text_field :environment, placeholder: 'production', class: 'form-control' %>
|
27
|
-
</fieldset>
|
28
|
-
<fieldset class='form-group'>
|
29
|
-
<%= f.label :deploy_url %>
|
30
|
-
<%= f.text_field :deploy_url, placeholder: 'https://', class: 'form-control' %>
|
31
|
-
<small class='text-muted'>Where is this stack deployed to?</small>
|
32
|
-
</fieldset>
|
33
|
-
<fieldset class='form-group checkbox'>
|
34
|
-
<%= label_tag :stack_ignore_ci do %>
|
35
|
-
<%= f.check_box :ignore_ci, class: 'checkbox' %>
|
36
|
-
Allow deploys regardless of CI status
|
37
|
-
<% end %>
|
38
|
-
</fieldset>
|
39
|
-
<fieldset>
|
40
|
-
<%= f.submit class: 'btn btn-primary' %>
|
41
|
-
</fieldset>
|
42
|
-
<% end %>
|
43
|
-
</section>
|
44
|
-
</div>
|
@@ -1,44 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en" data-controller="<%= controller_name %>" data-action="<%= action_name %>">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
6
|
-
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
7
|
-
<title><%= [Shipit.app_name, @stack.try!(:repo_name)].compact.join(' - ') %></title>
|
8
|
-
|
9
|
-
<%= favicon_link_tag %>
|
10
|
-
<%= stylesheet_link_tag :shipit_bs, media: 'all' %>
|
11
|
-
<%= javascript_include_tag :shipit_bs %>
|
12
|
-
|
13
|
-
<%= csrf_meta_tags %>
|
14
|
-
</head>
|
15
|
-
<body>
|
16
|
-
<% flash.each do |name, msg| %>
|
17
|
-
<%= content_tag :div, msg, class: ["flash-#{name}", :flash] %>
|
18
|
-
<% end %>
|
19
|
-
|
20
|
-
<nav class="navbar navbar-fixed-top navbar-light bg-faded">
|
21
|
-
<%= link_to "Shipit", root_path, class: "navbar-brand" %>
|
22
|
-
|
23
|
-
<ul class="nav navbar-nav">
|
24
|
-
<li class="nav-item active">
|
25
|
-
<%= link_to "#", class: "nav-link" do %>
|
26
|
-
<%= yield :page_title %>
|
27
|
-
<% end %>
|
28
|
-
</li>
|
29
|
-
</ul>
|
30
|
-
|
31
|
-
<div class="pull-xs-right">
|
32
|
-
<%= link_to "Shipit v#{Shipit::VERSION}", "https://github.com/Shopify/shipit-engine/tree/v#{Shipit::VERSION}" %>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class="container pull-xs-right">
|
36
|
-
<%= yield :primary_navigation %>
|
37
|
-
</div>
|
38
|
-
</nav>
|
39
|
-
|
40
|
-
<div class="main">
|
41
|
-
<%= yield %>
|
42
|
-
</div>
|
43
|
-
</body>
|
44
|
-
</html>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module TemplateRendererExtension
|
2
|
-
private
|
3
|
-
|
4
|
-
def render_template(template, layout_name = nil, *args)
|
5
|
-
if layout_name && bootstrap?(template)
|
6
|
-
layout_name = 'layouts/shipit_bootstrap'
|
7
|
-
end
|
8
|
-
super(template, layout_name, *args)
|
9
|
-
end
|
10
|
-
|
11
|
-
def bootstrap?(template)
|
12
|
-
template.identifier.start_with?('bootstrap/') || template.identifier.start_with?("#{Shipit.bootstrap_view_path}/")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
ActionView::TemplateRenderer.prepend(TemplateRendererExtension)
|