Skip to content

Commit

Permalink
Fix client generation (#2867)
Browse files Browse the repository at this point in the history
* Update autorest core to 3.6.3. Update nodejs to new secure LTS version for client generation. Fix permissions error in autorest Dockerfile for client generation.

* Added closing console line after api version generation
  • Loading branch information
carlowisse authored May 2, 2023
1 parent a26292d commit a68f9c1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Dockerfile.autorest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG REGISTRY
FROM ${REGISTRY}/ubi8/nodejs-14
FROM ${REGISTRY}/ubi8/nodejs-18

LABEL MAINTAINER="aos-azure"

Expand All @@ -14,8 +14,6 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.n
dnf install -y python3-pip && \
dnf clean all --enablerepo=\*

USER 1001

# Autorest
RUN npm install -g autorest@${AUTOREST_VERSION} && \
autorest --reset && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ E2E_FLAGS ?= -test.v --ginkgo.v --ginkgo.timeout 180m --ginkgo.flake-attempts=2
MARINER_VERSION = 20230321
FLUENTBIT_VERSION = 1.9.10
FLUENTBIT_IMAGE ?= ${RP_IMAGE_ACR}.azurecr.io/fluentbit:$(FLUENTBIT_VERSION)-cm$(MARINER_VERSION)
AUTOREST_VERSION = 3.6.2
AUTOREST_VERSION = 3.6.3
AUTOREST_IMAGE = quay.io/openshift-on-azure/autorest:${AUTOREST_VERSION}

ifneq ($(shell uname -s),Darwin)
Expand Down
23 changes: 21 additions & 2 deletions hack/build-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function generate_golang() {
local API_VERSION=$2
local FOLDER=$3

# Generating Track 1 SDK. Needs work to migrate to Track 2.
# Generating Track 1 Golang SDK
# Needs work to migrate to Track 2
docker run \
--platform=linux/amd64 \
--rm \
Expand Down Expand Up @@ -58,7 +59,7 @@ function generate_python() {
local API_VERSION=$2
local FOLDER=$3

# Generating Track 2 SDK
# Generating Track 2 Python SDK
docker run \
--platform=linux/amd64 \
--rm \
Expand Down Expand Up @@ -92,8 +93,26 @@ do
FOLDER=preview
fi

printf "\nGENERATING API v$API_VERSION\n"
printf "%*s\n" "${COLUMNS:-$(tput cols)}" "" | tr " " -

printf "CLEANING OLD API GENERATED FILES...\n"
clean "$API_VERSION" "$FOLDER"
printf "[\u2714] SUCCESS\n\n"

printf "GENERATING CHECKSUM...\n"
checksum "$API_VERSION" "$FOLDER"
printf "[\u2714] SUCCESS\n\n"

printf "GENERATING GOLANG SDK...\n"
generate_golang "$AUTOREST_IMAGE" "$API_VERSION" "$FOLDER"
printf "[\u2714] SUCCESS\n\n"

printf "GENERATING PYTHON SDK...\n"
generate_python "$AUTOREST_IMAGE" "$API_VERSION" "$FOLDER"
printf "[\u2714] SUCCESS\n\n"
printf "%*s\n" "${COLUMNS:-$(tput cols)}" "" | tr " " -
printf "\n"
done

printf "[\u2714] CLIENT GENERATION COMPLETED SUCCESSFULLY\n"

0 comments on commit a68f9c1

Please sign in to comment.