Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base url name #187

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/pkg/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ If no arguments are used, the command installs all the packages specified in the

If one or more output folders are specified, the command installs only the packages whose OutputFolder matches the specified folders. (OutputFolder is a field in the package manifest file.)

Set the environment variable BASE_URL to specify where package templates are downloaded from.
Set the environment variable ` + install.BaseUrlEnvName + ` to specify where package templates are downloaded from.
`,
Example: `ok pkg install networking
ok pkg install networking my-app
BASE_URL=../boilerplate/terraform ok install networking my-app
` + install.BaseUrlEnvName + `=../boilerplate/terraform ok pkg install networking my-app
`,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, outputFolders []string) error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
"strings"
)

const BaseUrlEnvName = "OK_BASE_URL"
const DefaultBaseUrl = "[email protected]:oslokommune/golden-path-boilerplate.git//"
const DefaultPackagePathPrefix = "boilerplate/terraform"

func Run(pkgManifestFilename string, outputFolders []string) error {
baseUrlOrPath := os.Getenv("BASE_URL")
baseUrlOrPath := os.Getenv(BaseUrlEnvName)

cmds, err := CreateBoilerplateCommands(pkgManifestFilename, outputFolders, baseUrlOrPath)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/pkg/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestInstall(t *testing.T) {
},
},
{
testName: "Should support URL in BASE_URL",
testName: "Should support URL in OK_BASE_URL",
packageManifestFilename: "package.yml",
baseUrl: "[email protected]:oslokommune/SOMETHING_ELSE.git//",
expectBoilerplateCommands: []*exec.Cmd{
Expand All @@ -56,7 +56,7 @@ func TestInstall(t *testing.T) {
),
},
}, {
testName: "Should support file path in BASE_URL",
testName: "Should support file path in OK_BASE_URL",
packageManifestFilename: "package.yml",
baseUrl: "..",
expectBoilerplateCommands: []*exec.Cmd{
Expand Down