-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue secret:generate, adds skeleton for secret:install
- Loading branch information
1 parent
a45c9f7
commit d2bdbfb
Showing
3 changed files
with
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env roundup | ||
set -eu -o pipefail | ||
|
||
|
||
describe "envy secret:install" | ||
|
||
before() { | ||
rm -rf tmp/spec/* | ||
} | ||
|
||
it_is_listed_in_help() { | ||
($ENVY help 2>&1) | grep -w secret:install | ||
} | ||
|
||
it_installs_the_secret() { | ||
SSH=false ENVY_SECRET_PATH=tmp/spec/envy.secret $ENVY secret:install target@system | ||
|
||
test 1 == 2 | ||
# # secret file has 32 byte | ||
# test 32 -eq $(cat tmp/spec/envy.secret | wc -c) | ||
# | ||
# # secret file is 0400 | ||
# test '-r--------' == $(ls -l tmp/spec/envy.secret | awk '{ print $1 }') | ||
} |
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,25 @@ | ||
package cli | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
import () | ||
|
||
/* | ||
* Copy the current secret via ${SSH_BINARY:-ssh} to a target account. | ||
*/ | ||
func do_secret_install(target_account string) { | ||
} | ||
|
||
func init() { | ||
var cmd = &cobra.Command{ | ||
Use: "secret:install", | ||
Short: "Install the current envy secret to a remote location", | ||
Long: `Install the current envy secret to a remote location`, | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
do_secret_install(args[0]) | ||
}, | ||
} | ||
|
||
rootCmd.AddCommand(cmd) | ||
} |