Skip to content

Commit

Permalink
fix: elixir, python, java, and dart publishing (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 5, 2024
1 parent a109fe6 commit dbc7070
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ release.properties
*.releaseBackup
repos/
openapitools.json
.venv
venv
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# can't use bookworm (latest LTS as of June23) yet, as elixir/erlang does not provide packages for it yet. Check if https://binaries.erlang-solutions.com/debian/dists/bookworm/ is available to change this
FROM openjdk:21-bullseye
FROM openjdk:21-bookworm

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates ssh bash

Expand Down Expand Up @@ -56,12 +56,12 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
# the following is a workaround for openjdk-11-jre-headless erroring due to not having a man path in slim-debian
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip ruby jq gnupg git gettext libffi-dev libssl-dev php composer php-curl php-dom php-xml php-simplexml php-xmlwriter maven pkg-config twine sudo apt-transport-https
RUN apt-get install -y --no-install-recommends python3 python3-dev python3-full python3-pip python3-venv ruby jq gnupg git gettext libffi-dev libssl-dev php composer php-curl php-dom php-xml php-simplexml php-xmlwriter maven pkg-config twine sudo apt-transport-https
# RUN apk add -U --no-cache ca-certificates bash nodejs npm python3 python3-dev py-pip ruby jq build-base gnupg git openssh curl gettext libffi libffi-dev openssl-dev php composer php-curl php7-tokenizer wget php-dom php-xml php-simplexml php-xmlwriter maven

RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN sudo apt-get update && sudo apt-get install google-cloud-cli
RUN sudo apt-get update -y && sudo apt-get install -y --no-install-recommends google-cloud-cli

# https://stackoverflow.com/questions/35736598/cannot-pip-install-cryptography-in-docker-alpine-linux-3-3-with-openssl-1-0-2g
#RUN apk add --no-cache \
Expand All @@ -76,9 +76,9 @@ RUN sudo apt-get update && sudo apt-get install google-cloud-cli

# RUN wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar -O openapi-generator-cli.jar

RUN npm install -g npm@7.21.0
RUN npm install -g npm@10.8.1
RUN npm i -g @openapitools/openapi-generator-cli
RUN openapi-generator-cli version-manager set 5.2.1
RUN openapi-generator-cli version-manager set 7.4.0

# dotnet
ENV PATH "$PATH:/root/.dotnet"
Expand Down Expand Up @@ -120,7 +120,7 @@ RUN td=$(mktemp) \

RUN gem install bundler -v 2.3.26 && \
apt-get update && \
apt-get install -y --no-install-recommends ruby-dev=1:2.7+2
apt-get install -y --no-install-recommends ruby-dev

ADD go.mod go.mod
ADD go.sum go.sum
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ desired version.
You may also manually build and publish this image using:

```shell script
docker build --platform linux/amd64 -t oryd/sdk:latest .
docker build -t oryd/sdk:latest .
docker tag oryd/sdk:latest oryd/sdk:v0.0.53
docker push oryd/sdk:v0.0.53
```
Expand All @@ -33,15 +33,15 @@ docker push oryd/sdk:v0.0.53
If you wish to debug some generators or build steps, you can run the image locally:

```shell script
docker run --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/project --name sdk --user "$(id -u):$(id -g)" -it oryd/sdk:v0.0.51 /bin/sh
docker run --mount type=bind,source="$(pwd)",target=/project --name sdk --user "$(id -u):$(id -g)" -it oryd/sdk:latest /bin/sh
```

### Debugging Failing Tests on CI

If a test fails in CI, you may run the following code snippet to reproduce the failure locally:

```shell script
docker run --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/project --name sdk -it oryd/sdk:v0.0.53 /bin/bash
docker run --mount type=bind,source="$(pwd)",target=/project --name sdk -it oryd/sdk:latest /bin/bash

export FORCE_PROJECT=client # or hydra or something else
export FORCE_VERSION=$(cat /project/spec/$FORCE_PROJECT/latest) # or a specific version, e.g. v1.2.17
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ elixir () {
}

# elixir is broken right now: https://github.com/ory/sdk/issues/350
#elixir
elixir
typescript
typescript_fetch
rust
Expand All @@ -356,7 +356,7 @@ php
python

# ruby is broken right now: https://github.com/ory/sdk/issues/357
# ruby
ruby
dotnet
dart

Expand Down
5 changes: 5 additions & 0 deletions scripts/prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ else
version=${FORCE_VERSION}
fi

# Python

python3 -m venv .venv
source .venv/bin/activate

####################################

if [ -z "${FORCE_PROJECT+x}" ]; then
Expand Down

0 comments on commit dbc7070

Please sign in to comment.