8000 Add initial version of generating script and the generated client by mbohlool · Pull Request #1 · kubernetes-client/python · GitHub
[go: up one dir, main page]

Skip to content

Add initial version of generating script and the generated client #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 2, 2016

Conversation

mbohlool
Copy link
Contributor

The first pull request for client-python is adding the generation script and a generated client with minimum modification.

CLIENT_ROOT=${SCRIPT_ROOT}/..

[[ -d ${SCRIPT_ROOT}/bin ]] || mkdir ${SCRIPT_ROOT}/bin
[[ -f ${SCRIPT_ROOT}/bin/swagger-codegen-cli.jar ]] || curl http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar > ${SCRIPT_ROOT}/bin/swagger-codegen-cli.jar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do they offer a maven task for this?

Copy link
Contributor Author
@mbohlool mbohlool Oct 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look like they do: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen-maven-plugin/README.md

Only issue here is I am using an unofficial jar file right now in my bin folder that has my latest fix to codegen If I can specify this in the maven plugin (to use the latest version from repo), I will change this to maven.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

8000

@mbohlool
Copy link
Contributor Author
mbohlool commented Nov 1, 2016

PTAL

fi

SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
CLIENT_ROOT=${SCRIPT_ROOT}/..

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put double quotes around in case the variable contains spaces? There are several occurrences later as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed them all. Please check again and let me know if I missed anything.

mvn -f "${SCRIPT_ROOT}/pom.xml" clean generate-sources -Dgenerator.spec.path="${SWAGGER_FILE}" -Dgenerator.output.path="${CLIENT_ROOT}" -Dgenerator.package.name=${PACKAGE_NAME}

echo "--- Patching generated code..."
# rm "${CLIENT_ROOT}/git_push.sh"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mbohlool
Copy link
Contributor Author
mbohlool commented Nov 2, 2016

Friendly ping!

@mbohlool mbohlool force-pushed the o1 branch 2 times, most recently from 2ef02b9 to 3e54dbc Compare November 2, 2016 20:38
@caesarxuchao
Copy link
caesarxuchao commented Nov 2, 2016

The script lgtm. I'll apply the label and we can improve the generated client in future iteration. @mbohlool feel free to self merge.

@mbohlool mbohlool added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2016
@mbohlool mbohlool merged commit d67df30 into master Nov 2, 2016
@mbohlool mbohlool deleted the o1 branch November 16, 2016 00:55
@mbohlool mbohlool added this to the v1.0 milestone Nov 17, 2016
yliaog pushed a commit to yliaog/client-python that referenced this pull request Jan 8, 2022
Copy over base folder of python-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0