23
23
24
24
repo_root=" $( dirname " ${BASH_SOURCE} " ) /../.."
25
25
26
- SWAGGER_JAR_URL=" https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar"
27
- SWAGGER_CODEGEN_JAR=" ${repo_root} /hack/python-sdk/openapi-generator-cli.jar"
26
+ # SWAGGER_JAR_URL="https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar"
27
+ # SWAGGER_CODEGEN_JAR="${repo_root}/hack/python-sdk/openapi-generator-cli.jar"
28
28
SWAGGER_CODEGEN_CONF=" ${repo_root} /hack/python-sdk/swagger_config.json"
29
29
SDK_OUTPUT_PATH=" ${repo_root} /sdk/python"
30
30
VERSION=0.1.4
37
37
echo " Generating OpenAPI specification ..."
38
38
echo " ./hack/update-codegen.sh already help us generate openapi specs ..."
39
39
40
- if [[ ! -f " $SWAGGER_CODEGEN_JAR " ]]; then
41
- echo " Downloading the swagger-codegen JAR package ..."
42
- wget -O " ${SWAGGER_CODEGEN_JAR} " ${SWAGGER_JAR_URL}
43
- fi
40
+ # if [[ ! -f "$SWAGGER_CODEGEN_JAR" ]]; then
41
+ # echo "Downloading the swagger-codegen JAR package ..."
42
+ # wget -O "${SWAGGER_CODEGEN_JAR}" ${SWAGGER_JAR_URL}
43
+ # fi
44
44
45
- if [ -z ` which java` ]; then
46
- apt-get update -y
47
- # TODO: update this fallback (remove it) when openjdk-11 completely deprecated
48
- echo " Installing OpenJDK 11 with fallback to OpenJDK 17"
49
- apt-get install -y openjdk-11-jdk || apt-get install -y openjdk-17-jdk
50
- fi
45
+
46
+ # Currently removed
47
+ # if [ -z `which java` ]; then
48
+ # apt-get update -y
49
+ # # TODO: update this fallback (remove it) when openjdk-11 completely deprecated
50
+ # echo "Installing OpenJDK 11 with fallback to OpenJDK 17"
51
+ # apt-get install -y openjdk-11-jdk || apt-get install -y openjdk-17-jdk
52
+ # fi
51
53
52
54
echo " Generating swagger file ..."
53
55
go run " ${repo_root} " /hack/swagger/main.go ${VERSION} > " ${SWAGGER_CODEGEN_FILE} "
@@ -56,7 +58,15 @@ echo "Removing previously generated files ..."
56
58
rm -rf " ${SDK_OUTPUT_PATH} " /docs/V1* .md " ${SDK_OUTPUT_PATH} " /jobset/models " ${SDK_OUTPUT_PATH} " /test/test_* .py
57
59
58
60
echo " Generating Python SDK for JobSet..."
59
- java -jar " ${SWAGGER_CODEGEN_JAR} " generate -i ${SWAGGER_CODEGEN_FILE} -g python -o " ${SDK_OUTPUT_PATH} " -c " ${SWAGGER_CODEGEN_CONF} "
61
+ # java -jar "${SWAGGER_CODEGEN_JAR}" generate -i ${SWAGGER_CODEGEN_FILE} -g python -o "${SDK_OUTPUT_PATH}" -c "${SWAGGER_CODEGEN_CONF}"
62
+ # Install the skds using docker
63
+ docker run --rm \
64
+ # Hooking up the whole repo onto the local folder
65
+ -v " ${repo_root} " :/local openapitools/openapi-generator-cli generate \
66
+ -i /local/ ${SWAGGER_CODEGEN_FILE} \
67
+ -g python \
68
+ -o /local/" ${SDK_OUTPUT_PATH} " \
69
+ -c ${SWAGGER_CODEGEN_FILE}
60
70
61
71
echo " Running post-generation script ..."
62
72
" ${repo_root} " /hack/python-sdk/post_gen.py
0 commit comments