From 7dc0ac0c4ee9a950e57c9b7b40ae710becc922bc Mon Sep 17 00:00:00 2001 From: Will Vedder Date: Tue, 6 Dec 2022 15:29:35 -0500 Subject: [PATCH] DXCDT-284: Remove dead env vars (#545) * Removing usage of env vars * Moving docsPath to closer to where its used Co-authored-by: Will Vedder --- .github/workflows/go.yml | 2 -- cmd/build_doc/main.go | 11 +---------- docs/ci.md | 25 ------------------------- internal/cli/build_doc.go | 6 ++++-- 4 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 docs/ci.md diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1e7ef711b..0b6b9cfeb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -58,8 +58,6 @@ jobs: AUTH0_CLI_CLIENT_DOMAIN: ${{ secrets.AUTH0_CLI_CLIENT_DOMAIN }} AUTH0_CLI_CLIENT_ID: ${{ secrets.AUTH0_CLI_CLIENT_ID }} AUTH0_CLI_CLIENT_SECRET: ${{ secrets.AUTH0_CLI_CLIENT_SECRET }} - AUTH0_CLI_REUSE_CONFIG: ${{ secrets.AUTH0_CLI_REUSE_CONFIG }} - AUTH0_CLI_OVERWRITE: ${{ secrets.AUTH0_CLI_OVERWRITE }} build: name: Build diff --git a/cmd/build_doc/main.go b/cmd/build_doc/main.go index 70078d453..564ecb716 100644 --- a/cmd/build_doc/main.go +++ b/cmd/build_doc/main.go @@ -1,20 +1,11 @@ package main import ( - "github.com/joeshaw/envdecode" - "github.com/auth0/auth0-cli/internal/cli" ) func main() { - var cfg struct { - Path string `env:"AUTH0_CLI_DOCS_PATH,default=./docs/"` - } - if err := envdecode.StrictDecode(&cfg); err != nil { - panic(err) - } - - err := cli.BuildDoc(cfg.Path) + err := cli.BuildDoc() if err != nil { panic(err) } diff --git a/docs/ci.md b/docs/ci.md deleted file mode 100644 index d54589427..000000000 --- a/docs/ci.md +++ /dev/null @@ -1,25 +0,0 @@ -# Continuous Integration - -## Integration Tests - -Integration tests can be run with: -```bash -make integration -``` - -`make integration` will build and run the `auth0-cli-config-generator` command which is responsible for ensuring that a valid auth0-cli config file exists before the integration tests run. If a valid auth0-cli config file doesn't exist, `auth0-cli-config-generator` will attempt to generate one based off command line flags or/and environment variables. - -`make integration` will then use [commander](https://github.com/commander-cli/commander) to run tests defined in [commander.yaml](./commander.yaml) - -The entities created during integration tests will be cleaned afterwards by the script `integration/test-cleanup.sh`. All the entities prefixed `integration-test-` will be deleted. - -To run integration tests as part of a CI pipeline, several environment variables need to be exported first. When these variables are set, `auth0-cli-config-generator` will generate a valid auth0-cli config file being retrieving a token for the client, removing the need to run `auth0 login`: -```bash -export AUTH0_CLI_CLIENT_NAME="integration" \ - AUTH0_CLI_CLIENT_DOMAIN="example-test-domain.au.auth0.com" \ - AUTH0_CLI_CLIENT_ID="example-client-id" \ - AUTH0_CLI_CLIENT_SECRET="example-client-secret" \ - AUTH0_CLI_REUSE_CONFIG="false" \ - AUTH0_CLI_OVERWRITE="true" -make integration -``` diff --git a/internal/cli/build_doc.go b/internal/cli/build_doc.go index b3f44d10e..e27e0674b 100644 --- a/internal/cli/build_doc.go +++ b/internal/cli/build_doc.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra/doc" ) -func BuildDoc(path string) error { +func BuildDoc() error { cli := &cli{} rootCmd := &cobra.Command{ @@ -20,8 +20,10 @@ func BuildDoc(path string) error { addPersistentFlags(rootCmd, cli) addSubcommands(rootCmd, cli) + docsPath := "./docs/" + err := doc.GenMarkdownTreeCustom(rootCmd, - path, + docsPath, func(fileName string) string { // prepend to the generated markdown if strings.HasSuffix(fileName, "auth0.md") {