Skip to content

Commit

Permalink
Fix CI search attribute registration (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed May 19, 2023
1 parent 8c170f7 commit 7007984
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions integ/docker-compose-init.sh
Expand Up @@ -3,6 +3,7 @@
# use new version of tctl so that we can skip the prompt
tctl config set version next


checkExists () {
# see https://github.com/temporalio/temporal/issues/4160
if tctl search-attribute list | grep -q "$1"; then
Expand All @@ -13,19 +14,31 @@ fi
}

echo "now trying to register iWF system search attributes..."

for run in {1..60}; do
for run in {1..120}; do
sleep 1
tctl search-attribute create -name IwfWorkflowType -type Keyword -y
sleep 0.1
tctl search-attribute create -name IwfGlobalWorkflowVersion -type Int -y
sleep 0.1
tctl search-attribute create -name IwfExecutingStateIds -type Keyword -y
sleep 0.1
if checkExists "IwfWorkflowType" ] && checkExists "IwfGlobalWorkflowVersion" && checkExists "IwfExecutingStateIds" ] ; then
echo "All search attributes are registered"
break
fi
tctl search-attribute create -name CustomKeywordField -type Keyword -y
sleep 0.1
tctl search-attribute create -name CustomIntField -type Int -y
sleep 0.1
tctl search-attribute create -name CustomBoolField -type Bool -y
sleep 0.1
tctl search-attribute create -name CustomDoubleField -type Double -y
sleep 0.1
tctl search-attribute create -name CustomDatetimeField -type Datetime -y
sleep 0.1
tctl search-attribute create -name CustomStringField -type text -y

if checkExists "IwfWorkflowType" ] && checkExists "IwfGlobalWorkflowVersion" && checkExists "IwfExecutingStateIds" && checkExists "CustomKeywordField" && checkExists "CustomIntField" && checkExists "CustomBoolField" && checkExists "CustomDoubleField" && checkExists "CustomDatetimeField" && checkExists "CustomStringField" ] ; then
echo "All search attributes are registered"
break
fi

done

tctl namespace register default
Expand Down

0 comments on commit 7007984

Please sign in to comment.