Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
137 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ Rake::TestTask.new(:test) do |t| | |
end | ||
|
||
task default: :test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module Shipit | ||
class CommandLineUser | ||
def present? | ||
false | ||
end | ||
|
||
def email | ||
'command_line@example.com' | ||
end | ||
|
||
def login | ||
'command_line' | ||
end | ||
|
||
def name | ||
'CommandLine' | ||
end | ||
|
||
def avatar_url | ||
'https://github.com/images/error/octocat_happy.gif' | ||
end | ||
|
||
def id | ||
end | ||
|
||
def github_id | ||
end | ||
|
||
def logged_in? | ||
false | ||
end | ||
|
||
def authorized? | ||
Shipit.authentication_disabled? | ||
end | ||
|
||
def stacks_contributed_to | ||
[] | ||
end | ||
|
||
def avatar_uri | ||
User::DEFAULT_AVATAR.dup | ||
end | ||
|
||
def created_at | ||
Time.at(0).utc | ||
end | ||
alias_method :updated_at, :created_at | ||
|
||
def read_attribute_for_serialization(attr) | ||
public_send(attr) | ||
end | ||
|
||
def github_api | ||
Shipit.github.api | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Shipit | ||
class CommandLineUserSerializer < UserSerializer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace :shipit do | ||
desc "Deploy from a running instance. " | ||
task deploy: :environment do | ||
begin | ||
stack = ENV['stack'] | ||
revision = ENV['revision'] | ||
|
||
raise ArgumentError.new('The first argument has to be a stack, e.g. shopify/shipit/production') if stack.nil? | ||
raise ArgumentError.new('The second argument has to be a revision') if revision.nil? | ||
|
||
module Shipit | ||
class Task | ||
def write(text) | ||
p text | ||
chunks.create!(text: text) | ||
end | ||
end | ||
end | ||
|
||
Shipit::Stack.run_deploy_in_foreground(stack: stack, revision: revision) | ||
rescue ArgumentError | ||
p "Use this command as follows:" | ||
p "bundle exec rake shipit:deploy stack='shopify/shipit/production' revision='593b1f07cec6c30df3f62d9e63b31dc0ff444098'" | ||
raise | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters