Skip to content

Commit

Permalink
remove jq and use json
Browse files Browse the repository at this point in the history
  • Loading branch information
gfournieriExec committed Jul 10, 2024
1 parent 7478c10 commit 1dd34d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile_Subgraph_generic
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ node {
println "Selected service name: '${userInput.targetRemoteHost}'"
}
stage('Setup Docker image') {
sh 'apt install jq'
sh 'apt install bash'
}
stage('Building subgraph') {
// Print working directory and list files for debugging
Expand Down
19 changes: 13 additions & 6 deletions generate_subgraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ generate_yaml() {
local output_file="subgraph.${network}.yaml"

# Read values from config.json
local start_block=$(jq -r ".${network}.STARTBLOCK" ${config_file})
local erc1538_address=$(jq -r ".${network}.ERC1538_ADDRESS" ${config_file})
local core_address=$(jq -r ".${network}.IEXECE_INTERFACE_TOKEN_CORE_ADDRESS" ${config_file})
local app_registry_address=$(jq -r ".${network}.APP_REGISTRY_ADDRESS" ${config_file})
local dataset_registry_address=$(jq -r ".${network}.DATATSET_REGISTRY_ADDRESS" ${config_file})
local workerpool_registry_address=$(jq -r ".${network}.WORKERPOOL_REGISTRY_ADDRESS" ${config_file})
# local start_block=$(jq -r ".${network}.STARTBLOCK" ${config_file})
local start_block=$(echo ${config_file} | json ${network}.STARTBLOCK)
# local erc1538_address=$(jq -r ".${network}.ERC1538_ADDRESS" ${config_file})
local erc1538_address=$(echo ${config_file} | json ${network}.ERC1538_ADDRESS)
# local core_address=$(jq -r ".${network}.IEXECE_INTERFACE_TOKEN_CORE_ADDRESS" ${config_file})
local core_address=$(echo ${config_file} | json ${network}.IEXECE_INTERFACE_TOKEN_CORE_ADDRESS)
# local app_registry_address=$(jq -r ".${network}.APP_REGISTRY_ADDRESS" ${config_file})
local app_registry_address=$(echo ${config_file} | json ${network}.APP_REGISTRY_ADDRESS)
# local dataset_registry_address=$(jq -r ".${network}.DATATSET_REGISTRY_ADDRESS" ${config_file})
local dataset_registry_address=$(echo ${config_file} | json ${network}.DATATSET_REGISTRY_ADDRESS)
# local workerpool_registry_address=$(jq -r ".${network}.WORKERPOOL_REGISTRY_ADDRESS" ${config_file})
local workerpool_registry_address=$(echo ${config_file} | json ${network}.WORKERPOOL_REGISTRY_ADDRESS)


# Replace placeholders in the template and create the output file
sed -e "s/#NETWORK_NAME#/network: ${network}/g" \
Expand Down

0 comments on commit 1dd34d9

Please sign in to comment.