@@ -48,7 +48,7 @@ if [[ ! ${work_dir} || -d {work_dir} ]]; then
4848fi
4949
5050# Delete temp directory on exit
51- trap " rm -rf ${work_dir} " EXIT
51+ # trap "rm -rf ${work_dir}" EXIT
5252
5353mkdir ${work_dir} /git_repo # Where the git repo will be created
5454mkdir ${work_dir} /sdk_backup # Backup of the SDK to check for new modules
@@ -60,7 +60,7 @@ rm -rf ${work_dir}/sdk_to_push/.git
6060
6161# Initialize git repo
6262cd ${work_dir} /git_repo
63- git clone ${REPO_URL_SSH} ./
63+ git clone ${REPO_URL_SSH} ./ --quiet
6464git config user.name " ${COMMIT_NAME} "
6565git config user.email " ${COMMIT_EMAIL} "
6666
@@ -80,6 +80,7 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do
8080 service_changes=$( git status --porcelain " services/$service " )
8181
8282 if [[ -n " $service_changes " ]]; then
83+ echo -e " \n>> Detected changes in $service service"
8384 if [[ " $BRANCH_PREFIX " != " main" ]]; then
8485 git switch main # This is needed to create a new branch for the service without including the previously committed files
8586 branch=" $BRANCH_PREFIX /$service "
@@ -99,25 +100,25 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do
99100
100101 if [[ " $branch " != " main" ]]; then
101102 echo " >> Creating PR for $service "
102-
103103 git commit -m " Generate $service "
104104 git push origin " $branch "
105105 gh pr create --title " Generator: Update SDK /services/$service " --body " $COMMIT_INFO " --head " $branch " --base " main"
106106 else
107- echo " >> Pushing changes for $service service..."
108107
109108 # If lint or test fails for a service, we skip it and continue to the next one
110109 make lint skip-non-generated-files=true service=$service || {
111- echo " ! Linting failed for $service "
110+ echo " ! Linting failed for $service . THE UPDATE OF THIS SERVICE WILL BE SKIPPED. "
112111 continue
113112 }
114- make test skip-non-generated-files=true service= $service || {
115- echo " ! Testing failed for $service "
113+ go test ./services/ ${service} -timeout=5m -cover -count=1 || {
114+ echo " ! Testing failed for $service . THE UPDATE OF THIS SERVICE WILL BE SKIPPED. "
116115 continue
117116 }
118117
119- git commit -m " Generate $service : $COMMIT_INFO "
120- git push origin " $branch "
118+ echo " >> Pushing changes for $service service..."
119+ echo " >> git diff for service $service : $( git status --porcelain " services/$service " ) "
120+ # git commit -m "Generate $service: $COMMIT_INFO"
121+ # git push origin "$branch"
121122 fi
122123 fi
123124done
0 commit comments