-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
13 changed files
with
97 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--help | ||
ping | ||
server --help | ||
server | ||
server deploy |
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,7 @@ | ||
title 'DevOps Toolbox' | ||
|
||
import 'server', image: 'my-rails-app', allow_deploy: true | ||
|
||
action 'ping' do | ||
say 'PONG' | ||
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,25 @@ | ||
title 'Server commands' | ||
summary 'Build and manage all the servers' | ||
|
||
# Declare that we need three variables in the `import` directive | ||
# One mandatory (:image) and two with a default fallback values | ||
require_context :image | ||
require_context :allow_deploy, default: false | ||
require_context :env, default: 'development' | ||
|
||
# $ run server : default command | ||
action do |args| | ||
say 'g`Context`:' | ||
p context | ||
say 'g`Args`:' | ||
p args | ||
end | ||
|
||
help 'Deploy to production' | ||
action 'deploy' do | ||
if context[:allow_deploy] | ||
say 'DEPLOYING' | ||
else | ||
say! "r`Deployment not allowed`" | ||
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
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 @@ | ||
Usage: | ||
run ping | ||
run server | ||
run [COMMAND] (--help | -h) |
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,14 @@ | ||
DevOps Toolbox | ||
|
||
Usage: | ||
run ping | ||
run server | ||
run [COMMAND] (--help | -h) | ||
|
||
Commands: | ||
nb`server` | ||
Build and manage all the servers | ||
|
||
Options: | ||
--help, -h | ||
Show this message |
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 @@ | ||
PONG |
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 @@ | ||
[32mContext[0m: | ||
{:image=>"my-rails-app", :allow_deploy=>true, :env=>"development"} | ||
[32mArgs[0m: | ||
{"server"=>true, "deploy"=>false, "--help"=>false} |
16 changes: 16 additions & 0 deletions
16
spec/approvals/integration/require-context/run server --help
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,16 @@ | ||
Server commands | ||
|
||
Build and manage all the servers | ||
|
||
Usage: | ||
run server | ||
run server deploy | ||
run server (--help | -h) | ||
|
||
Commands: | ||
nb`deploy` | ||
Deploy to production | ||
|
||
Options: | ||
--help, -h | ||
Show this message |
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 @@ | ||
DEPLOYING |
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