File tree Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 18
18
@echo " shell - open a shell in the web container"
19
19
@echo " test-shell - open a shell in test environment"
20
20
@echo " "
21
+ @echo " generate - create json file from TEMPLATE"
22
+ @echo " "
21
23
@echo " help - see this text"
22
24
23
25
@@ -50,5 +52,10 @@ ifneq (1, ${MK_KEEP_DOCKER_UP})
50
52
endif
51
53
52
54
.PHONY : test-shell
53
- test-shell : .env
55
+ test-shell :
54
56
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ def process_all_files_in_path(
49
49
50
50
for filename in glob .glob (os .path .join (folder_path , "*.json" )):
51
51
try :
52
+ if "TEMPLATE" in filename :
53
+ continue
52
54
key , value = process (filename )
53
55
if key :
54
56
config_map [key ] = value
Original file line number Diff line number Diff line change
1
+ {
2
+ "whiteboard_tag": "@WHITEBOARD_TAG@",
3
+ "jira_project_key": "@JIRA_PROJECT_KEY@",
4
+ "action": "@ACTION@",
5
+ "enabled": "@ENABLED@"
6
+ }
You can’t perform that action at this time.
0 commit comments