Merge pull request #6779 from dokku/6755-ps-set-global
Add --global flag to ps:set
This commit is contained in:
2 files changed
+54
No files matched your search
@@ -68,10 +68,16 @@ func main() {
|
|||||||
err = ps.CommandScale(appName, *skipDeploy, processTuples)
|
err = ps.CommandScale(appName, *skipDeploy, processTuples)
|
||||||
case "set":
|
case "set":
|
||||||
args := flag.NewFlagSet("ps:set", flag.ExitOnError)
|
args := flag.NewFlagSet("ps:set", flag.ExitOnError)
|
||||||
|
global := args.Bool("global", false, "--global: set a global property")
|
||||||
args.Parse(os.Args[2:])
|
args.Parse(os.Args[2:])
|
||||||
appName := args.Arg(0)
|
appName := args.Arg(0)
|
||||||
property := args.Arg(1)
|
property := args.Arg(1)
|
||||||
value := args.Arg(2)
|
value := args.Arg(2)
|
||||||
|
if *global {
|
||||||
|
appName = "--global"
|
||||||
|
property = args.Arg(0)
|
||||||
|
value = args.Arg(1)
|
||||||
|
}
|
||||||
err = ps.CommandSet(appName, property, value)
|
err = ps.CommandSet(appName, property, value)
|
||||||
case "start":
|
case "start":
|
||||||
args := flag.NewFlagSet("ps:start", flag.ExitOnError)
|
args := flag.NewFlagSet("ps:start", flag.ExitOnError)
|
||||||
|
|||||||
@@ -45,6 +45,54 @@ teardown() {
|
|||||||
assert_output_contains "$CID" 6
|
assert_output_contains "$CID" 6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(ps:set) procfile" {
|
||||||
|
run /bin/bash -c "dokku ps:set --global procfile-path .dokku/Procfile"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:report $TEST_APP --ps-computed-procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output ".dokku/Procfile"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:report $TEST_APP --ps-global-procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output ".dokku/Procfile"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:report $TEST_APP --ps-procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output ""
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:set --global procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:report $TEST_APP --ps-computed-procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output "Procfile"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:report $TEST_APP --ps-global-procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output "Procfile"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:report $TEST_APP --ps-procfile-path"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output ""
|
||||||
|
assert_success
|
||||||
|
}
|
||||||
|
|
||||||
@test "(ps:scale) procfile commands extraction" {
|
@test "(ps:scale) procfile commands extraction" {
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions"
|
||||||
cat <<EOF >"$DOKKU_LIB_ROOT/data/ps/$TEST_APP/Procfile"
|
cat <<EOF >"$DOKKU_LIB_ROOT/data/ps/$TEST_APP/Procfile"
|
||||||
|
|||||||
Reference in new issue
Block a user