Skip to content

Commit

Permalink
Merge branch 'main' into release/v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fcarrero committed Apr 22, 2024
2 parents 802f437 + c4c696f commit c6eb224
Show file tree
Hide file tree
Showing 91 changed files with 2,900 additions and 11,722 deletions.
49 changes: 49 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
kind: pipeline
type: kubernetes
name: default

trigger:
branch:
- main
event:
- pull_request


steps:
- name: build_image
image: plugins/ecr
privileged: true
settings:
dockerfile: Dockerfile
registry: 462204803675.dkr.ecr.us-east-1.amazonaws.com
debug: true
target: builder
tags:
- "${DRONE_BUILD_NUMBER}"
environment:
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
PLUGIN_SSH_AGENT_KEY:
from_secret: SSH_KEY
DOCKER_BUILDKIT: 1
ECR_CREATE_REPOSITORY: true
PLUGIN_REPO: ${DRONE_REPO}
- name: validate
image: 462204803675.dkr.ecr.us-east-1.amazonaws.com/${DRONE_REPO}:${DRONE_BUILD_NUMBER}
depends_on:
- build_image
commands:
- openapi-generator-cli validate -i api.yaml
- name: dummy generator
image: 462204803675.dkr.ecr.us-east-1.amazonaws.com/${DRONE_REPO}:${DRONE_BUILD_NUMBER}
depends_on:
- build_image
commands:
- openapi-generator-cli generate -i api.yaml -g openapi-yaml

image_pull_secrets:
- ECR_PULL_SECRET
- DOCKERCONFIG
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
generator: openapi-yaml
openapi-file: api.yaml
generator-tag: v6.6.0
generator-tag: v7.4.0
- name: check if api.yaml are equals
run: |
if diff -q _build/api.yaml openapi-yaml-client/openapi/openapi.yaml >/dev/null; then
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM node:14 as builder
FROM node:16 as builder

# Install OpenJDK-11
RUN apt-get update && \
apt-get install -y openjdk-11-jre-headless && \
apt-get clean;

RUN npm install @openapitools/openapi-generator-cli -g
RUN openapi-generator-cli version-manager set 6.3.0
RUN openapi-generator-cli version-manager set 7.3.0
WORKDIR /app

COPY parameters/ parameters/
COPY requestBodies requestBodies/
COPY resources resources/
COPY schemas schemas/
COPY templates templates/
COPY Makefile Makefile
COPY api.yaml api.yaml
44 changes: 0 additions & 44 deletions Jenkinsfile

This file was deleted.

77 changes: 4 additions & 73 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,80 +1,11 @@
API_README_VERSION_ID = 641deb4041d58005f2c45bf3
merge:
npx @openapitools/openapi-generator-cli generate \
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli:v7.4.0 generate \
-g openapi-yaml \
-i api.yaml \
-p outputFile=_build/api.yaml \
-i /local/api.yaml \
-p outputFile=local/_build/api.yaml \
--skip-validate-spec

python:
npx @openapitools/openapi-generator-cli generate \
-i api.yaml \
-g python-nextgen \
-o ../conekta-python \
-c config-python.json \
--global-property modelTests=false

java:
mkdir -p conekta-java && \
npx @openapitools/openapi-generator-cli generate \
-i api.yaml \
-g java \
-o ../ct-conekta-java \
-c config-java.json \
--global-property modelTests=false \
--additional-properties=hideGenerationTimestamp=true

go:
npx @openapitools/openapi-generator-cli generate \
-i api.yaml \
-g go \
-o ../conekta-go \
-c config-go.json \
--global-property modelTests=false \
--additional-properties=hideGenerationTimestamp=true

ruby:
npx @openapitools/openapi-generator-cli generate \
-i api.yaml \
-g ruby \
-o ../conekta-ruby \
-c config-ruby.json \
--global-property modelTests=false

csharp:
mkdir -p conekta-.net && \
cp .openapi-generator-ignore conekta-.net/.openapi-generator-ignore && \
rm -rf ../conekta-.net/docs && \
rm -rf ../conekta-.net/src/Conekta.net/Model && \
npx @openapitools/openapi-generator-cli generate \
-i api.yaml \
-g csharp-netcore \
-o ../conekta-.net \
-c config-netcore.json \
--global-property modelTests=false

php:
npx @openapitools/openapi-generator-cli generate \
-i api.yaml \
-g php \
-o ../conekta-php \
-c config-php.json \
--global-property modelTests=false

node:
rm -rf ../conekta-node/api && \
rm -rf ../conekta-node/model && \
npx @openapitools/openapi-generator-cli generate -i api.yaml -g typescript-axios \
-o ../conekta-node -c config-node.json \
--global-property apiDocs=false --global-property apiTests=true

dart:
rm -rf ../conekta-dart/lib && \
rm -rf ../conekta-dart/doc && \
npx @openapitools/openapi-generator-cli generate -i api.yaml -g dart-dio \
-o ../conekta-dart \
-c config-dart.json \
--global-property modelTests=false

update-readme:
make merge && rdme openapi _build/api.yaml --id=$(API_README_VERSION_ID) --key=${README_API_KEY}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ How to use
</h2>

<h3>
java generator proyect
go generator proyect

</h3>

```
make java
make go
```

<h2>
Expand Down
Loading

0 comments on commit c6eb224

Please sign in to comment.