Skip to content

Commit fac70ac

Browse files
committed
[NDR-318] NDRI Directory override
1 parent c644187 commit fac70ac

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ check-packages:
6868
./lambdas/venv/bin/pip-audit -r $(REPORTS_REQUIREMENTS)
6969
./lambdas/venv/bin/pip-audit -r $(ALERTING_REQUIREMENTS)
7070

71-
build-and-deploy-sandbox: ## Build a sandbox and deploy code. If no SANDBOX_NAME is provided it will use your current branch as the name. All options are optional. It will default to building and deploying using 'main', You can skip building infrastructure by BUILD_INFRA=false. Usage: make build-and-deploy-sandbox SANDBOX_NAME=<sandbox_name> NDRI_WORKFLOW_BRANCH=<branch> NDRI_BRANCH=<branch> NDR_WORKFLOW_BRANCH=<branch> NDR_BRANCH=<branch> BUILD_INFRA=<true|false>
71+
build-and-deploy-sandbox: ## Build a sandbox and deploy code. If no SANDBOX_NAME is provided it will use your current branch as the name. It will default to building and deploying using 'main', You can skip building infrastructure by BUILD_INFRA=false. Usage: make build-and-deploy-sandbox SANDBOX_NAME=<sandbox_name> NDRI_WORKFLOW_BRANCH=<branch> NDRI_BRANCH=<branch> NDR_WORKFLOW_BRANCH=<branch> NDR_BRANCH=<branch> BUILD_INFRA=<true|false> NDRI_DIR_LOC_OVERRIDE=<dir_location>
7272
@./scripts/build_and_deploy_sandbox.sh \
7373
$(if $(NDRI_WORKFLOW_BRANCH),--ndri_workflow_branch=$(NDRI_WORKFLOW_BRANCH)) \
7474
$(if $(NDRI_BRANCH),--ndri_branch=$(NDRI_BRANCH)) \
7575
$(if $(NDR_WORKFLOW_BRANCH),--ndr_workflow_branch=$(NDR_WORKFLOW_BRANCH)) \
7676
$(if $(NDR_BRANCH),--ndr_branch=$(NDR_BRANCH)) \
7777
$(if $(SANDBOX_NAME),--sandbox_name=$(SANDBOX_NAME)) \
78-
$(if $(BUILD_INFRA),--build_infra=$(BUILD_INFRA))
78+
$(if $(BUILD_INFRA),--build_infra=$(BUILD_INFRA)) \
79+
$(if $(NDRI_DIR_LOC_OVERRIDE),--ndri_dir_loc_override=$(NDRI_DIR_LOC_OVERRIDE))
7980

8081
download-api-certs: ## Downloads mTLS certificates (use with dev envs only). Usage: make download-api-certs WORKSPACE=<workspace>
8182
rm -rf ./lambdas/mtls_env_certs/$(WORKSPACE)

scripts/build_and_deploy_sandbox.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
NDR_DIRECTORY="$HOME/Documents/national-document-repository"
5-
NDRI_DIRECTORY="$HOME/Documents/national-document-repository-infrastructure"
6-
7-
CONFIG_FILE="$HOME/.ndr_config"
8-
if [[ -f "$CONFIG_FILE" ]]; then
9-
source "$CONFIG_FILE"
10-
fi
11-
124
# Initialize variables to track options
5+
NDR_DIRECTORY="$(pwd)"
6+
PARENT_DIR="$(dirname "$NDR_DIRECTORY")"
7+
NDRI_DIRECTORY="$PARENT_DIR/national-document-repository-infrastructure"
138
BUILD_INFRA=true
149
NDRI_BRANCH="main"
1510
NDRI_WORKFLOW_BRANCH="main"
@@ -47,9 +42,12 @@ for arg in "$@"; do
4742
--build_infra=*)
4843
BUILD_INFRA="${arg#*=}"
4944
;;
45+
--ndri_dir_loc_override=*)
46+
NDRI_DIRECTORY="${arg#*=}"
47+
;;
5048
*)
5149
echo "Unknown argument: $arg"
52-
echo "Usage: $0 [--ndri_workflow_branch=<branch>] [--ndri_branch=<branch>] [--ndr_branch=<branch>] [--ndr_workflow_branch=<branch>] [--sandbox_name=<sandbox_name>] [--build_infra=<boolean>]"
50+
echo "Usage: $0 [--ndri_workflow_branch=<branch>] [--ndri_branch=<branch>] [--ndr_branch=<branch>] [--ndr_workflow_branch=<branch>] [--sandbox_name=<sandbox_name>] [--build_infra=<true|false>] [--ndri_dir_loc_override=<absolute_path>]"
5351
exit 1
5452
;;
5553
esac

0 commit comments

Comments
 (0)