Skip to content

Commit d6472f7

Browse files
authored
Merge pull request #1481 from gooddata/JTYC-STAGING-CHANGES
feat: auto-load staging secrets from .env and fix DS_PASSWORD plumbing
2 parents a20aae6 + 538a05e commit d6472f7

File tree

291 files changed

+34743
-35997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+34743
-35997
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# (C) 2026 GoodData Corporation
2+
# Staging environment secrets (copy to .env and fill in)
3+
STAGING_ADMIN_TOKEN=
4+
STAGING_DS_PASSWORD=

Makefile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# (C) 2021 GoodData Corporation
2+
# Load .env if it exists (staging secrets, gitignored)
3+
-include .env
4+
25
# list all full paths to files and directories in CWD containing "gooddata", filter out ones ending by "client"
36
NO_CLIENT_GD_PROJECTS_ABS = $(filter-out %client, $(wildcard $(CURDIR)/packages/*gooddata*))
47
# for each path, take only the base name of the path
58
NO_CLIENT_GD_PROJECTS_DIRS = $(foreach dir, $(NO_CLIENT_GD_PROJECTS_ABS), $(notdir $(dir)))
69
# TODO: replace API_VERSION in the future by call to API
710
API_VERSION="v1"
8-
# Generate from localhost
11+
# Default: generate from localhost; use `make api-client STAGING=1` to download from remote
12+
ifdef STAGING
13+
BASE_URL="https://demo-cicd.cloud.gooddata.com"
14+
else
915
BASE_URL="http://localhost:3000"
10-
# Generate from PROD
11-
# BASE_URL="https://demo-cicd.cloud.gooddata.com"
16+
endif
1217
URL="${BASE_URL}/api/${API_VERSION}/schemas"
1318

1419
include ci_tests.mk
@@ -90,18 +95,21 @@ test:
9095

9196
.PHONY: test-staging
9297
test-staging:
93-
@test -n "$(TOKEN)" || (echo "ERROR: TOKEN is required. Usage: make test-staging TOKEN=<api-token>" && exit 1)
94-
$(MAKE) -C packages/gooddata-sdk test-staging TOKEN=$(TOKEN)
98+
@test -n "$(STAGING_ADMIN_TOKEN)" || (echo "ERROR: STAGING_ADMIN_TOKEN is required. Set it in .env or pass on CLI." && exit 1)
99+
@test -n "$(STAGING_DS_PASSWORD)" || (echo "ERROR: STAGING_DS_PASSWORD is required. Set it in .env or pass on CLI." && exit 1)
100+
$(MAKE) -C packages/gooddata-sdk test-staging TOKEN=$(STAGING_ADMIN_TOKEN) DS_PASSWORD=$(STAGING_DS_PASSWORD)
95101

96102
.PHONY: clean-staging
97103
clean-staging:
98-
@test -n "$(TOKEN)" || (echo "ERROR: TOKEN is required. Usage: make clean-staging TOKEN=<api-token>" && exit 1)
99-
cd packages/tests-support && STAGING=1 TOKEN="$(TOKEN)" python clean_staging.py
104+
@test -n "$(STAGING_ADMIN_TOKEN)" || (echo "ERROR: STAGING_ADMIN_TOKEN is required. Set it in .env or pass on CLI." && exit 1)
105+
@test -n "$(STAGING_DS_PASSWORD)" || (echo "ERROR: STAGING_DS_PASSWORD is required. Set it in .env or pass on CLI." && exit 1)
106+
cd packages/tests-support && STAGING=1 TOKEN="$(STAGING_ADMIN_TOKEN)" DS_PASSWORD="$(STAGING_DS_PASSWORD)" python clean_staging.py
100107

101108
.PHONY: load-staging
102109
load-staging:
103-
@test -n "$(TOKEN)" || (echo "ERROR: TOKEN is required. Usage: make load-staging TOKEN=<api-token>" && exit 1)
104-
cd packages/tests-support && STAGING=1 TOKEN="$(TOKEN)" python upload_demo_layout.py
110+
@test -n "$(STAGING_ADMIN_TOKEN)" || (echo "ERROR: STAGING_ADMIN_TOKEN is required. Set it in .env or pass on CLI." && exit 1)
111+
@test -n "$(STAGING_DS_PASSWORD)" || (echo "ERROR: STAGING_DS_PASSWORD is required. Set it in .env or pass on CLI." && exit 1)
112+
cd packages/tests-support && STAGING=1 TOKEN="$(STAGING_ADMIN_TOKEN)" DS_PASSWORD="$(STAGING_DS_PASSWORD)" python upload_demo_layout.py
105113

106114
.PHONY: release
107115
release:

0 commit comments

Comments
 (0)