Giter VIP home page Giter VIP logo

sdk's Introduction

Generated SDKs for the ORY Ecosystem

All SDKs provided in this repository are generated using openapi-generator.

Publish the Docker Image

To publish the SDK Builder Docker Image, create a new GitHub release with the desired version.

You may also manually build and publish this image using:

docker build --platform linux/amd64 -t oryd/sdk:latest .
docker tag oryd/sdk:latest oryd/sdk:v0.0.51
docker push oryd/sdk:v0.0.51

Running the Image Locally

If you wish to debug some generators or build steps, you can run the image locally:

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

Debugging Failing Tests on CI

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

docker run --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/project --name sdk -it oryd/sdk:v0.0.51 /bin/sh

export FORCE_VERSION=v1.2.17
export FORCE_PROJECT=client # or hydra or something else
cd /project

./scripts/generate.sh
./scripts/test.sh

Commit a new spec

Place the spec in spec/<project>/<version>.json (e.g. spec/hydra/v0.0.0-alpha.1.json) and create a commit that references both the project and the version git commit -a -m "Add spec for <project>:<version>" (e.g. git commit -a -m "Add spec for hydra:v0.0.0-alpha.1").

Do not create multiple commits adding several specs in one PR, as only the latest commit will be checked when it lands on master.

Because this is an automated process, it is highly recommended to add, commit, and push the spec file directly to master in one go!

You can create a PR if you're making changes to the build chain.

Upgrading OpenAPI Generator

Upgrading OpenAPI Generator versions requires careful upgrading of the Java pom.xml. The file might contain new versions for dependencies, but if overwritten, will not work with the release pipeline.

Therefore, the pom.xml file is being always overwritten from the contrib/poms directory for each project. To update any dependencies, the changes must thus be made there. We recommend running the openapi generator manually on the local machine and diffing the changes with contents in contrib/poms.

Publishing

PHP - Packagist

Install PHP and composer. Then, run the install command to initialize everything:

export PROJECT=hydra
cd clients/${PROJECT}/php
composer install

Then, push the directory to a git remote of your choosing and also publish the tag you want to release the package as. You can take a look at ./scripts/publish.sh to understand how to accomplish that.

Python - PyPi / pip

First, install all the necessary tools and python3:

python3 -m pip install --user --upgrade setuptools wheel twine

Next, create a PyPi account and API Token and set the env vars to:

export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<token>

Then, publish the project (and set the project name):

export PROJECT=hydra
cd clients/${PROJECT}/python
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

Ruby

You need to set GEM_HOST_API_KEY

Java - Maven Central

For keys read https://blackdoor.github.io/blog/maven-cd/

Due to a bug in openapi-generator that appears in Java11+, please disable javadoc generation:

mvn <cmd> -Dmaven.javadoc.skip=true

To test the build for Java, run:

$ ./scripts/generate.sh
$ cd clients/<project>/java
$ mvn test-compile

You will also need a PGP keypair that is associated with one of the owners of the sh.ory group and that is published on one of the public key servers. For more details, see: https://dzone.com/articles/publish-your-artifacts-to-maven-central

mvn clean

# THESE VALUES ARE EXAMPLES - PLEASE PICK THE APPROPRIATE `tag`, etc
mvn -Dtag=client-0.0.1-alpha.1 release:update-version \
  -DreleaseVersion=0.0.1-alpha.1 -DdevelopmentVersion=0.0.1-alpha.1-SNAPSHOT \
  -Darguments="-Dmaven.javadoc.skip=true" -Dresume=false

mvn release:perform -Darguments="-Dmaven.javadoc.skip=true" -Dresume=false

sdk's People

Contributors

aeneasr avatar ory-bot avatar jonas-jonas avatar marcuzz avatar kevgo avatar nickufer avatar zepatrik avatar benehiko avatar allenkaplan avatar mojotalantikite avatar yholkamp avatar ichordedionysos avatar zageron avatar vinckr avatar ukonnra avatar nekuromento avatar k-yle avatar hperl avatar kolotaev avatar gen1us2k avatar amirzahavi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.