Skip to content

Commit

Permalink
feat: Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet committed Nov 27, 2024
1 parent 45fcbf1 commit 6470c87
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/download-oas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
# Move oas to root level
mkdir ${ROOT_DIR}/oas
cd ${work_dir}
git clone ${OAS_REPO}
git clone ${OAS_REPO} --quiet

for service_dir in ${work_dir}/${OAS_REPO_NAME}/services/*; do
max_version_dir=""
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate-sdk/generate-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ fi
# Generate SDK for the specified language
case "${LANGUAGE}" in
go)
echo -e "\nGenerating the Go SDK...\n"
echo -e "\n>> Generating the Go SDK...\n"

source ${LANGUAGE_GENERATORS_FOLDER_PATH}/${LANGUAGE}.sh
# Usage: generate_go_sdk GENERATOR_PATH GIT_HOST GIT_USER_ID [GIT_REPO_ID] [SDK_REPO_URL]
generate_go_sdk ${jar_path} ${GIT_HOST} ${GIT_USER_ID} ${GIT_REPO_ID} ${SDK_REPO_URL}
;;
python)
echo -e "\nGenerating the Python SDK...\n"
echo -e "\n>> Generating the Python SDK...\n"

source ${LANGUAGE_GENERATORS_FOLDER_PATH}/${LANGUAGE}.sh
# Usage: generate_python_sdk GENERATOR_PATH GIT_HOST GIT_USER_ID [GIT_REPO_ID] [SDK_REPO_URL]
generate_python_sdk ${jar_path} ${GIT_HOST} ${GIT_USER_ID} ${GIT_REPO_ID} ${SDK_REPO_URL}
;;
*)
echo "SDK language not supported."
echo "! SDK language not supported."
exit 1
;;
esac
1 change: 0 additions & 1 deletion scripts/generate-sdk/languages/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,4 @@ generate_go_sdk() {
cd ${SDK_REPO_LOCAL_PATH}
goimports -w ${SERVICES_FOLDER}/
make sync-tidy

}
15 changes: 8 additions & 7 deletions scripts/sdk-create-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [[ ! ${work_dir} || -d {work_dir} ]]; then
fi

# Delete temp directory on exit
trap "rm -rf ${work_dir}" EXIT
# trap "rm -rf ${work_dir}" EXIT

mkdir ${work_dir}/git_repo # Where the git repo will be created
mkdir ${work_dir}/sdk_backup # Backup of the SDK to check for new modules
Expand All @@ -60,7 +60,7 @@ rm -rf ${work_dir}/sdk_to_push/.git

# Initialize git repo
cd ${work_dir}/git_repo
git clone ${REPO_URL_SSH} ./
git clone ${REPO_URL_SSH} ./ --quiet
git config user.name "${COMMIT_NAME}"
git config user.email "${COMMIT_EMAIL}"

Expand Down Expand Up @@ -108,16 +108,17 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do

# If lint or test fails for a service, we skip it and continue to the next one
make lint skip-non-generated-files=true service=$service || {
echo "! Linting failed for $service"
echo "! Linting failed for $service. THE UPDATE OF THIS SERVICE WILL BE SKIPPED."
continue
}
make test skip-non-generated-files=true service=$service || {
echo "! Testing failed for $service"
go test ./services/${service} -timeout=5m -cover -count=1 || {
echo "! Testing failed for $service. THE UPDATE OF THIS SERVICE WILL BE SKIPPED."
continue
}

git commit -m "Generate $service: $COMMIT_INFO"
git push origin "$branch"
echo ">> Actually pushing changes to main for $service service..."
# git commit -m "Generate $service: $COMMIT_INFO"
# git push origin "$branch"
fi
fi
done

0 comments on commit 6470c87

Please sign in to comment.