Skip to content

Commit 08071c9

Browse files
author
Bryan Sieber
committed
Add to assist users
1 parent 2b0d02f commit 08071c9

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ help:
1818
@echo " shell - open a shell in the web container"
1919
@echo " test-shell - open a shell in test environment"
2020
@echo ""
21+
@echo " generate - create json file from TEMPLATE"
22+
@echo ""
2123
@echo " help - see this text"
2224

2325

@@ -50,5 +52,10 @@ ifneq (1, ${MK_KEEP_DOCKER_UP})
5052
endif
5153

5254
.PHONY: test-shell
53-
test-shell: .env
55+
test-shell:
5456
docker-compose -f ./docker-compose.yaml -f ./tests/infra/docker-compose.test.yaml run web
57+
58+
59+
.PHONY: generate
60+
generate:
61+
./generate-helper.sh

generate-helper.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
default_action="default_action"
3+
enabled="true"
4+
read -p "Enter the jira_project_key (required):" JIRA_PROJECT_KEY
5+
read -p "Enter the whiteboard_tag (required):" WHITEBOARD_TAG
6+
read -p "Enter the action (blank=default_action):" ACTION && [[ -z "$ACTION" ]] && ACTION="$default_action"
7+
read -p "Start enabled? (blank=true):" ENABLED && [[ -z "$ENABLED" ]] && ENABLED="$enabled"
8+
9+
echo "Generate file: src/jbi/whiteboard_tags/${WHITEBOARD_TAG}.json"
10+
sed -e "s|@ENABLED@|$ENABLED|g" -e "s|@ACTION@|$ACTION|g" -e "s|@JIRA_PROJECT_KEY@|$JIRA_PROJECT_KEY|g" -e "s|@WHITEBOARD_TAG@|$WHITEBOARD_TAG|g" src/jbi/whiteboard_tags/TEMPLATE > src/jbi/whiteboard_tags/${WHITEBOARD_TAG}.json

src/core/configurator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def process_all_files_in_path(
4949

5050
for filename in glob.glob(os.path.join(folder_path, "*.json")):
5151
try:
52+
if "TEMPLATE" in filename:
53+
continue
5254
key, value = process(filename)
5355
if key:
5456
config_map[key] = value

src/jbi/whiteboard_tags/TEMPLATE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"whiteboard_tag": "@WHITEBOARD_TAG@",
3+
"jira_project_key": "@JIRA_PROJECT_KEY@",
4+
"action": "@ACTION@",
5+
"enabled": "@ENABLED@"
6+
}

0 commit comments

Comments
 (0)