renamed NUV_ to OPS_ env vars
diff --git a/auth/login.go b/auth/login.go
index 335ac2f..5b909b4 100644
--- a/auth/login.go
+++ b/auth/login.go
@@ -29,8 +29,8 @@
"os"
"path/filepath"
- "github.com/mitchellh/go-homedir"
"github.com/apache/openserverless-cli/config"
+ "github.com/mitchellh/go-homedir"
"github.com/zalando/go-keyring"
)
@@ -44,8 +44,8 @@
nuv login <apihost> [<user>]
Login to a Nuvolaris instance. If no user is specified, the default user "nuvolaris" is used.
-You can use the environment variables NUV_APIHOST and NUV_USER to avoid specifying them on the command line.
-And NUV_PASSWORD to avoid entering the password interactively.
+You can use the environment variables OPS_APIHOST and OPS_USER to avoid specifying them on the command line.
+And OPS_PASSWORD to avoid entering the password interactively.
Options:
-h, --help Show usage`
@@ -75,12 +75,12 @@
args := flag.Args()
- if len(args) == 0 && os.Getenv("NUV_APIHOST") == "" {
+ if len(args) == 0 && os.Getenv("OPS_APIHOST") == "" {
flag.Usage()
return nil, errors.New("missing apihost")
}
- password := os.Getenv("NUV_PASSWORD")
+ password := os.Getenv("OPS_PASSWORD")
if password == "" {
fmt.Print("Enter Password: ")
pwd, err := AskPassword()
@@ -91,17 +91,17 @@
fmt.Println()
}
- apihost := os.Getenv("NUV_APIHOST")
+ apihost := os.Getenv("OPS_APIHOST")
if apihost == "" {
apihost = args[0]
}
url := apihost + whiskLoginPath
// try to get the user from the environment
- user := os.Getenv("NUV_USER")
+ user := os.Getenv("OPS_USER")
if user == "" {
// if env var not set, try to get it from the command line
- if os.Getenv("NUV_APIHOST") != "" {
+ if os.Getenv("OPS_APIHOST") != "" {
// if apihost env var was set, treat the first arg as the user
if len(args) > 0 {
user = args[0]
@@ -110,7 +110,7 @@
// if apihost env var was not set, treat the second arg as the user
if len(args) > 1 {
user = args[1]
- }
+ }
}
}
diff --git a/common.go b/common.go
index 001d18d..a7d941e 100644
--- a/common.go
+++ b/common.go
@@ -29,28 +29,28 @@
)
// default files
-const NUVFILE = "nuvfile.yml"
-const NUVROOT = "nuvroot.json"
-const NUVOPTS = "nuvopts.txt"
-const CONFIGFILE = "config.json"
+const OPSFILE = "opsfile.yml"
+const OPSROOT = "opsroot.json"
+const DOCOPTS = "docopts.txt"
const PREREQ = "prereq.yml"
+const CONFIGFILE = "config.json"
// repo where download tasks
-const NUVREPO = "http://github.com/apache/openserverless-task"
+const OPSREPO = "http://github.com/apache/openserverless-task"
// branch where download tasks
// defaults to test - will be changed in compilation
//go:embed version.txt
-var NuvVersion string
+var OpsVersion string
//go:embed branch.txt
-var NuvBranch string
+var OpsBranch string
//go:embed runtimes.json
var WSK_RUNTIMES_JSON string
-// Represents nuvroot.json. It is used to parse the file.
+// Represents opsroot.json. It is used to parse the file.
type NuvRootJSON struct {
Version string `json:"version"`
Config map[string]interface{} `json:"config"`
@@ -60,18 +60,18 @@
const DefaultNuvPort = 9768
func getNuvPort() string {
- port := os.Getenv("NUV_PORT")
+ port := os.Getenv("OPS_PORT")
if port == "" {
port = fmt.Sprintf("%d", DefaultNuvPort)
}
//nolint:errcheck
- os.Setenv("NUV_PORT", port)
+ os.Setenv("OPS_PORT", port)
return port
}
// get defaults
func getNuvRoot() (string, error) {
- root := os.Getenv("NUV_ROOT")
+ root := os.Getenv("OPS_ROOT")
if root == "" {
dir, err := os.Getwd()
if err == nil {
@@ -82,27 +82,27 @@
}
}
//nolint:errcheck
- os.Setenv("NUV_ROOT", root)
+ os.Setenv("OPS_ROOT", root)
return root, nil
}
func getNuvRepo() string {
- repo := os.Getenv("NUV_REPO")
+ repo := os.Getenv("OPS_REPO")
if repo == "" {
repo = NUVREPO
}
//nolint:errcheck
- os.Setenv("NUV_REPO", repo)
+ os.Setenv("OPS_REPO", repo)
return repo
}
func getNuvBranch() string {
- branch := os.Getenv("NUV_BRANCH")
+ branch := os.Getenv("OPS_BRANCH")
if branch == "" {
branch = strings.TrimSpace(NuvBranch)
}
//nolint:errcheck
- os.Setenv("NUV_BRANCH", branch)
+ os.Setenv("OPS_BRANCH", branch)
return branch
}
@@ -113,7 +113,7 @@
return NuvRootJSON{}, err
}
if err := json.Unmarshal(json_buf, &data); err != nil {
- warn("nuvroot.json parsed with an error", err)
+ warn("opsroot.json parsed with an error", err)
}
return data, nil
}
diff --git a/main.go b/main.go
index d9a7ba2..9f62a75 100644
--- a/main.go
+++ b/main.go
@@ -83,25 +83,25 @@
}
func setNuvRootPluginEnv() {
- if os.Getenv("NUV_ROOT_PLUGIN") == "" {
+ if os.Getenv("OPS_ROOT_PLUGIN") == "" {
//nolint:errcheck
- os.Setenv("NUV_ROOT_PLUGIN", os.Getenv("NUV_PWD"))
+ os.Setenv("OPS_ROOT_PLUGIN", os.Getenv("OPS_PWD"))
}
- trace("set NUV_ROOT_PLUGIN", os.Getenv("NUV_ROOT_PLUGIN"))
+ trace("set OPS_ROOT_PLUGIN", os.Getenv("OPS_ROOT_PLUGIN"))
}
func info() {
- fmt.Println("NUV_VERSION:", os.Getenv("NUV_VERSION"))
- fmt.Println("NUV_BRANCH:", os.Getenv("NUV_BRANCH"))
+ fmt.Println("OPS_VERSION:", os.Getenv("OPS_VERSION"))
+ fmt.Println("OPS_BRANCH:", os.Getenv("OPS_BRANCH"))
fmt.Println("OPS_CMD:", os.Getenv("OPS_CMD"))
fmt.Println("OPS_BIN:", os.Getenv("OPS_BIN"))
- fmt.Println("NUV_TMP:", os.Getenv("NUV_TMP"))
+ fmt.Println("OPS_TMP:", os.Getenv("OPS_TMP"))
fmt.Println("OPS_HOME:", os.Getenv("OPS_HOME"))
- fmt.Println("NUV_ROOT:", os.Getenv("NUV_ROOT"))
- fmt.Println("NUV_REPO:", os.Getenv("NUV_REPO"))
- fmt.Println("NUV_PWD:", os.Getenv("NUV_PWD"))
- fmt.Println("NUV_OLARIS:", os.Getenv("NUV_OLARIS"))
- fmt.Println("NUV_ROOT_PLUGIN:", os.Getenv("NUV_ROOT_PLUGIN"))
+ fmt.Println("OPS_ROOT:", os.Getenv("OPS_ROOT"))
+ fmt.Println("OPS_REPO:", os.Getenv("OPS_REPO"))
+ fmt.Println("OPS_PWD:", os.Getenv("OPS_PWD"))
+ fmt.Println("OPS_OLARIS:", os.Getenv("OPS_OLARIS"))
+ fmt.Println("OPS_ROOT_PLUGIN:", os.Getenv("OPS_ROOT_PLUGIN"))
//fmt.Println("OPS_TOOLS:", os.Getenv("OPS_TOOLS"))
//fmt.Println("OPS_COREUTILS:", os.Getenv("OPS_COREUTILS"))
}
@@ -145,7 +145,7 @@
log.Fatalf("error: %v", err)
}
if err := setNuvOlarisHash(dir); err != nil {
- log.Fatal("unable to set NUV_OLARIS...", err.Error())
+ log.Fatal("unable to set OPS_OLARIS...", err.Error())
}
case "retry":
@@ -218,11 +218,11 @@
}
// set runtime version as environment variable
- if os.Getenv("NUV_VERSION") != "" {
- NuvVersion = os.Getenv("NUV_VERSION")
+ if os.Getenv("OPS_VERSION") != "" {
+ NuvVersion = os.Getenv("OPS_VERSION")
} else {
NuvVersion = strings.TrimSpace(NuvVersion)
- os.Setenv("NUV_VERSION", NuvVersion)
+ os.Setenv("OPS_VERSION", NuvVersion)
}
// setup OPS_CMD
@@ -253,19 +253,19 @@
// ensure there is ~/.nuv/tmp
err = setupTmp()
if err != nil {
- log.Fatalf("cannot setup NUV_TMP: %s", err.Error())
+ log.Fatalf("cannot setup OPS_TMP: %s", err.Error())
}
- // setup the NUV_PWD variable
+ // setup the OPS_PWD variable
err = setNuvPwdEnv()
if err != nil {
- log.Fatalf("cannot setup NUV_PWD: %s", err.Error())
+ log.Fatalf("cannot setup OPS_PWD: %s", err.Error())
}
// setup the envvar for the embedded tools
os.Setenv("OPS_TOOLS", strings.Join(append(mainTools, tools.ToolList...), " "))
- // NUV_REPO && NUV_ROOT_PLUGIN
+ // OPS_REPO && OPS_ROOT_PLUGIN
getNuvRepo()
setNuvRootPluginEnv()
@@ -277,7 +277,7 @@
log.Println("Welcome to ops! Setting up...")
olarisDir, err = pullTasks(true, true)
if err != nil {
- log.Fatalf("cannot locate or download NUV_ROOT: %s", err.Error())
+ log.Fatalf("cannot locate or download OPS_ROOT: %s", err.Error())
}
// just updated, do not repeat
if len(args) == 2 && args[1] == "-update" {
@@ -289,7 +289,7 @@
}
}
if err = setNuvOlarisHash(olarisDir); err != nil {
- os.Setenv("NUV_OLARIS", "<local>")
+ os.Setenv("OPS_OLARIS", "<local>")
}
// set the enviroment variables from the config
@@ -423,15 +423,15 @@
}
func setNuvPwdEnv() error {
- if os.Getenv("NUV_PWD") == "" {
+ if os.Getenv("OPS_PWD") == "" {
dir, err := os.Getwd()
if err != nil {
return err
}
//nolint:errcheck
- os.Setenv("NUV_PWD", dir)
+ os.Setenv("OPS_PWD", dir)
}
- trace("set NUV_PWD", os.Getenv("NUV_PWD"))
+ trace("set OPS_PWD", os.Getenv("OPS_PWD"))
return nil
}
diff --git a/main_test.go b/main_test.go
index 79568b5..a58ef1c 100644
--- a/main_test.go
+++ b/main_test.go
@@ -77,19 +77,19 @@
}
func TestSetupNuvRootPlugin(t *testing.T) {
- // Test case 1: NUV_ROOT_PLUGIN is not set
- os.Unsetenv("NUV_ROOT_PLUGIN")
- os.Setenv("NUV_PWD", "/path/to/nuv")
+ // Test case 1: OPS_ROOT_PLUGIN is not set
+ os.Unsetenv("OPS_ROOT_PLUGIN")
+ os.Setenv("OPS_PWD", "/path/to/nuv")
setNuvRootPluginEnv()
- if os.Getenv("NUV_ROOT_PLUGIN") != "/path/to/nuv" {
- t.Errorf("NUV_ROOT_PLUGIN not set correctly, expected /path/to/nuv but got %s", os.Getenv("NUV_ROOT_PLUGIN"))
+ if os.Getenv("OPS_ROOT_PLUGIN") != "/path/to/nuv" {
+ t.Errorf("OPS_ROOT_PLUGIN not set correctly, expected /path/to/nuv but got %s", os.Getenv("OPS_ROOT_PLUGIN"))
}
- // Test case 2: NUV_ROOT_PLUGIN is already set
- os.Setenv("NUV_ROOT_PLUGIN", "/path/to/nuv/root")
+ // Test case 2: OPS_ROOT_PLUGIN is already set
+ os.Setenv("OPS_ROOT_PLUGIN", "/path/to/nuv/root")
setNuvRootPluginEnv()
- if os.Getenv("NUV_ROOT_PLUGIN") != "/path/to/nuv/root" {
- t.Errorf("NUV_ROOT_PLUGIN not set correctly, expected /path/to/nuv/root but got %s", os.Getenv("NUV_ROOT_PLUGIN"))
+ if os.Getenv("OPS_ROOT_PLUGIN") != "/path/to/nuv/root" {
+ t.Errorf("OPS_ROOT_PLUGIN not set correctly, expected /path/to/nuv/root but got %s", os.Getenv("OPS_ROOT_PLUGIN"))
}
}
diff --git a/nuv.go b/nuv.go
index a774e79..10a077c 100644
--- a/nuv.go
+++ b/nuv.go
@@ -41,13 +41,13 @@
}
func help() error {
- if os.Getenv("NUV_NO_NUVOPTS") == "" && exists(".", NUVOPTS) {
+ if os.Getenv("OPS_NO_NUVOPTS") == "" && exists(".", NUVOPTS) {
os.Args = []string{"envsubst", "-no-unset", "-i", NUVOPTS}
return envsubst.EnvsubstMain()
}
// In case of syntax error, Task will return an error
list := "-l"
- if os.Getenv("NUV_NO_NUVOPTS") != "" {
+ if os.Getenv("OPS_NO_NUVOPTS") != "" {
list = "--list-all"
}
_, err := Task("-t", NUVFILE, list)
@@ -101,16 +101,16 @@
return res
}
-// sets up a tmp folder and NUV_TMP envvar
+// sets up a tmp folder and OPS_TMP envvar
func setupTmp() error {
var err error
- tmp := os.Getenv("NUV_TMP")
+ tmp := os.Getenv("OPS_TMP")
if tmp == "" {
tmp, err = homedir.Expand("~/.nuv/tmp")
if err != nil {
return err
}
- os.Setenv("NUV_TMP", tmp)
+ os.Setenv("OPS_TMP", tmp)
}
return os.MkdirAll(tmp, 0755)
}
@@ -223,7 +223,7 @@
savedArgs := loadSavedArgs()
// parsed args
- if os.Getenv("NUV_NO_NUVOPTS") == "" && exists(".", NUVOPTS) {
+ if os.Getenv("OPS_NO_NUVOPTS") == "" && exists(".", NUVOPTS) {
trace("PREPARSE:", rest)
parsedArgs := parseArgs(readfile(NUVOPTS), rest)
prefix := []string{"-t", NUVFILE}
diff --git a/nuv_test.go b/nuv_test.go
index 24262e4..5109706 100644
--- a/nuv_test.go
+++ b/nuv_test.go
@@ -139,7 +139,7 @@
nuvdir, _ := homedir.Expand("~/.nuv")
os.RemoveAll(nuvdir)
setupTmp()
- fmt.Println(nhpath(os.Getenv("NUV_TMP")))
+ fmt.Println(nhpath(os.Getenv("OPS_TMP")))
os.RemoveAll(nuvdir)
// Output:
// /home/.nuv/tmp
diff --git a/plugin.go b/plugin.go
index 353266e..937edb2 100644
--- a/plugin.go
+++ b/plugin.go
@@ -204,7 +204,7 @@
}
func newPlugins() (*plugins, error) {
- localDir := os.Getenv("NUV_ROOT_PLUGIN")
+ localDir := os.Getenv("OPS_ROOT_PLUGIN")
localOlarisFolders := make([]string, 0)
nuvOlarisFolders := make([]string, 0)
diff --git a/plugin_test.go b/plugin_test.go
index ff983aa..5dd1ce0 100644
--- a/plugin_test.go
+++ b/plugin_test.go
@@ -70,7 +70,7 @@
t.Run("success: get all the nuvroots.json from plugins with 1 plugin", func(t *testing.T) {
tempDir := t.TempDir()
plgFolder := setupPluginTest(tempDir, t)
- os.Setenv("NUV_ROOT_PLUGIN", tempDir)
+ os.Setenv("OPS_ROOT_PLUGIN", tempDir)
nuvRoots, err := GetNuvRootPlugins()
require.NoError(t, err)
@@ -80,7 +80,7 @@
t.Run("success: get all the nuvroots.json from plugins with 2 plugins", func(t *testing.T) {
tempDir := t.TempDir()
- os.Setenv("NUV_ROOT_PLUGIN", tempDir)
+ os.Setenv("OPS_ROOT_PLUGIN", tempDir)
plgFolder := setupPluginTest(tempDir, t)
// create the olaris-test2 folder
@@ -107,7 +107,7 @@
t.Run("empty: no plugins folder found (olaris-*)", func(t *testing.T) {
tempDir := t.TempDir()
- os.Setenv("NUV_ROOT_PLUGIN", tempDir)
+ os.Setenv("OPS_ROOT_PLUGIN", tempDir)
// Test when the folder is not found
nuvRoots, err := GetNuvRootPlugins()
@@ -119,7 +119,7 @@
func TestFindPluginTask(t *testing.T) {
t.Run("success: plugin task found in ./olaris-test", func(t *testing.T) {
tempDir := t.TempDir()
- os.Setenv("NUV_ROOT_PLUGIN", tempDir)
+ os.Setenv("OPS_ROOT_PLUGIN", tempDir)
plgFolder := setupPluginTest(tempDir, t)
fld, err := findTaskInPlugins("test")
@@ -129,7 +129,7 @@
t.Run("error: no plugins folder found (olaris-*)", func(t *testing.T) {
tempDir := t.TempDir()
- os.Setenv("NUV_ROOT_PLUGIN", tempDir)
+ os.Setenv("OPS_ROOT_PLUGIN", tempDir)
// Test when the folder is not found
fld, err := findTaskInPlugins("grep")
@@ -143,7 +143,7 @@
tempDir := t.TempDir()
plgFolder := setupPluginTest(tempDir, t)
- os.Setenv("NUV_ROOT_PLUGIN", tempDir)
+ os.Setenv("OPS_ROOT_PLUGIN", tempDir)
p, err := newPlugins()
require.NoError(t, err)
@@ -154,7 +154,7 @@
t.Run("non existent local dir results in empty local field", func(t *testing.T) {
localDir := "/path/to/nonexistent/dir"
- os.Setenv("NUV_ROOT_PLUGIN", localDir)
+ os.Setenv("OPS_ROOT_PLUGIN", localDir)
p, err := newPlugins()
require.NoError(t, err)
require.NotNil(t, p)
diff --git a/prepare.go b/prepare.go
index 38ed336..d5bbd09 100644
--- a/prepare.go
+++ b/prepare.go
@@ -242,7 +242,7 @@
return err
}
debug("olaris hash", h.Hash().String())
- os.Setenv("NUV_OLARIS", h.Hash().String())
- trace("NUV_OLARIS", os.Getenv("NUV_OLARIS"))
+ os.Setenv("OPS_OLARIS", h.Hash().String())
+ trace("OPS_OLARIS", os.Getenv("OPS_OLARIS"))
return nil
}
diff --git a/prepare_test.go b/prepare_test.go
index df5735b..d23aa05 100644
--- a/prepare_test.go
+++ b/prepare_test.go
@@ -82,9 +82,9 @@
NuvBranch = "0.1.0-testing"
nuvdir, _ := homedir.Expand("~/.nuv")
_ = os.RemoveAll(nuvdir)
- _ = os.Setenv("NUV_BIN", workDir)
+ _ = os.Setenv("OPS_BIN", workDir)
dir, _ := downloadTasksFromGitHub(true, true)
err := setNuvOlarisHash(dir)
require.NoError(t, err)
- require.NotEmpty(t, os.Getenv("NUV_OLARIS"))
+ require.NotEmpty(t, os.Getenv("OPS_OLARIS"))
}
diff --git a/serve.go b/serve.go
index 6476ece..36a4746 100644
--- a/serve.go
+++ b/serve.go
@@ -33,7 +33,7 @@
func Serve(olarisDir string, args []string) error {
flag := flag.NewFlagSet("serve", flag.ExitOnError)
flag.Usage = func() {
- fmt.Println(`Serve a local directory on http://localhost:9768. You can change port with the NUV_PORT environment variable.
+ fmt.Println(`Serve a local directory on http://localhost:9768. You can change port with the OPS_PORT environment variable.
Usage:
nuv -serve [options] <dir>
@@ -72,7 +72,7 @@
// run nuv server and open browser
port := getNuvPort()
- webDirPath := joinpath(os.Getenv("NUV_PWD"), webDir)
+ webDirPath := joinpath(os.Getenv("OPS_PWD"), webDir)
log.Println("Serving directory: " + webDirPath)
if !noBrowserFlag {
diff --git a/tests/auto_setup.bats b/tests/auto_setup.bats
index 173394f..64e9c30 100644
--- a/tests/auto_setup.bats
+++ b/tests/auto_setup.bats
@@ -33,7 +33,7 @@
@test "wrong branch fails to setup" {
run rm -rf ~/.nuv
- export NUV_BRANCH=wrong
+ export OPS_BRANCH=wrong
run nuv
assert_failure
assert_output --partial "Welcome to ops! Setting up..."
@@ -42,7 +42,7 @@
@test "correct branch setups" {
run rm -rf ~/.nuv
- export NUV_BRANCH=0.1.0
+ export OPS_BRANCH=0.1.0
run nuv
assert_success
assert_output --partial "Welcome to ops! Setting up..."
diff --git a/tests/info.bats b/tests/info.bats
index 8d58df8..1e21668 100644
--- a/tests/info.bats
+++ b/tests/info.bats
@@ -19,7 +19,7 @@
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
export NO_COLOR=1
- export NUV_VERSION="test"
+ export OPS_VERSION="test"
}
@test "version" {
@@ -33,10 +33,10 @@
@test "-info" {
run nuv -info
WD=$(pwd)
- assert_line "NUV_VERSION: test"
- assert_line "NUV_PWD: $WD"
- assert_line "NUV_ROOT: $WD/olaris"
- assert_line "NUV_TMP: $HOME/.nuv/tmp"
- assert_line --partial "NUV_OLARIS: "
+ assert_line "OPS_VERSION: test"
+ assert_line "OPS_PWD: $WD"
+ assert_line "OPS_ROOT: $WD/olaris"
+ assert_line "OPS_TMP: $HOME/.nuv/tmp"
+ assert_line --partial "OPS_OLARIS: "
assert_success
}
\ No newline at end of file
diff --git a/tests/login.bats b/tests/login.bats
index 76d6ac4..51730bd 100644
--- a/tests/login.bats
+++ b/tests/login.bats
@@ -32,45 +32,45 @@
assert_line "nuv login <apihost> [<user>]"
}
-@test "nuv -login with NUV_PASSWORD env does not prompt for password" {
- export NUV_PASSWORD=1234
+@test "nuv -login with OPS_PASSWORD env does not prompt for password" {
+ export OPS_PASSWORD=1234
run nuv -login localhost
refute_line "Enter Password:"
}
-@test "nuv -login with NUV_USER env defines username" {
- export NUV_PASSWORD=1234
- export NUV_USER=foo
+@test "nuv -login with OPS_USER env defines username" {
+ export OPS_PASSWORD=1234
+ export OPS_USER=foo
run nuv -login localhost
assert_line "Logging in as foo to localhost"
}
-@test "nuv -login with NUV_USER and NUV_PASSWORD env" {
- export NUV_PASSWORD=1234
- export NUV_USER=foo
+@test "nuv -login with OPS_USER and OPS_PASSWORD env" {
+ export OPS_PASSWORD=1234
+ export OPS_USER=foo
run nuv -login localhost
assert_line "Logging in as foo to localhost"
refute_line "Enter Password:"
}
-@test "nuv -login with NUV_APIHOST env" {
- export NUV_APIHOST=localhost
- export NUV_PASSWORD=1234
+@test "nuv -login with OPS_APIHOST env" {
+ export OPS_APIHOST=localhost
+ export OPS_PASSWORD=1234
run nuv -login
assert_line "Logging in as nuvolaris to localhost"
}
-@test "nuv -login with NUV_APIHOST and NUV_USER env" {
- export NUV_APIHOST=localhost
- export NUV_USER=foo
- export NUV_PASSWORD=1234
+@test "nuv -login with OPS_APIHOST and OPS_USER env" {
+ export OPS_APIHOST=localhost
+ export OPS_USER=foo
+ export OPS_PASSWORD=1234
run nuv -login
assert_line "Logging in as foo to localhost"
}
-@test "nuv -login with NUV_APIHOST, user is now first argument" {
- export NUV_APIHOST=localhost
- export NUV_PASSWORD=1234
+@test "nuv -login with OPS_APIHOST, user is now first argument" {
+ export OPS_APIHOST=localhost
+ export OPS_PASSWORD=1234
run nuv -login hello
assert_line "Logging in as hello to localhost"
refute_line "Enter Password:"
diff --git a/tests/olaris/sub/vars/nuvfile.yml b/tests/olaris/sub/vars/nuvfile.yml
index 01468c7..2f90ed4 100644
--- a/tests/olaris/sub/vars/nuvfile.yml
+++ b/tests/olaris/sub/vars/nuvfile.yml
@@ -89,7 +89,7 @@
tmp:
silent: true
cmds:
- - echo $NUV_TMP
+ - echo $OPS_TMP
clean:
silent: true
diff --git a/tests/plugin.bats b/tests/plugin.bats
index aa39414..aa2f029 100644
--- a/tests/plugin.bats
+++ b/tests/plugin.bats
@@ -19,7 +19,7 @@
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
export NO_COLOR=1
- export NUV_BRANCH="$(cat ../branch.txt)"
+ export OPS_BRANCH="$(cat ../branch.txt)"
run rm -rf ~/.nuv
}
diff --git a/tests/prereq.bats b/tests/prereq.bats
index 979789d..7c4e5a4 100644
--- a/tests/prereq.bats
+++ b/tests/prereq.bats
@@ -19,7 +19,7 @@
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
export NO_COLOR=1
- export NUV_BRANCH="0.1.0-testing"
+ export OPS_BRANCH="0.1.0-testing"
rm -Rvf ~/.nuv/
cd prereq
}
diff --git a/tests/prereq_yml.bats b/tests/prereq_yml.bats
index 4a55cbc..7999665 100644
--- a/tests/prereq_yml.bats
+++ b/tests/prereq_yml.bats
@@ -19,7 +19,7 @@
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
export NO_COLOR=1
- export NUV_BRANCH="0.1.0-testing"
+ export OPS_BRANCH="0.1.0-testing"
rm -Rvf _bin >/dev/null
export COUNT=1
}
diff --git a/tests/update.bats b/tests/update.bats
index a0721f0..f10e0de 100644
--- a/tests/update.bats
+++ b/tests/update.bats
@@ -29,27 +29,27 @@
}
@test "nuv -update with old version warns" {
- NUV_VERSION=0.0.0 run nuv -update
+ OPS_VERSION=0.0.0 run nuv -update
assert_line --partial "Your nuv version (0.0.0) is older than the required version in nuvroot.json"
assert_line "Attempting to update nuv..."
assert_success
}
@test "nuv -update with bad version" {
- NUV_VERSION=notsemver run nuv -update
+ OPS_VERSION=notsemver run nuv -update
assert_line "Unable to validate nuv version notsemver : Invalid Semantic Version"
assert_success
}
@test "nuv -update with newer version" {
- NUV_VERSION=10.2.3 run nuv -update
+ OPS_VERSION=10.2.3 run nuv -update
assert_line "Tasks are already up to date!"
assert_success
}
@test "nuv -update on branch" {
run rm -rf ~/.nuv
- export NUV_BRANCH=0.1.0
+ export OPS_BRANCH=0.1.0
run nuv -update
assert_line "Nuvfiles downloaded successfully"
assert_success
diff --git a/tests/update_branch.bats b/tests/update_branch.bats
index dd679b1..1c8a21a 100644
--- a/tests/update_branch.bats
+++ b/tests/update_branch.bats
@@ -19,10 +19,10 @@
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
export NO_COLOR=1
- export NUV_BRANCH="$(cat ../branch.txt)"
+ export OPS_BRANCH="$(cat ../branch.txt)"
rm -rf ~/.nuv
run nuv -update
- cd ~/.nuv/$NUV_BRANCH/olaris
+ cd ~/.nuv/$OPS_BRANCH/olaris
}
@test "nuv -update on olaris with old commit updates correctly" {