Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger build for v3 jsvt #12496

Open
wants to merge 1,742 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1742 commits
Select commit Hold shift + click to select a range
133c6c4
Update swagger_sdk_gen.sh
ankitverma659 Feb 24, 2022
71e1fe9
added tests files for springboot generated code
HugoMario Feb 25, 2022
2473b15
Merge pull request #11728 from swagger-api/spring-custom-tests
HugoMario Feb 25, 2022
7807aae
added new petstore sample file
HugoMario Feb 25, 2022
a9292d8
Merge pull request #11729 from swagger-api/petstore-sample
HugoMario Feb 25, 2022
4150f76
bump jackson to 2.13.2
frantuma Apr 12, 2022
fcd24e7
prepare release 3.0.34
frantuma Apr 12, 2022
4df553e
bump snapshot 3.0.35-SNAPSHOT
frantuma Apr 13, 2022
b0d8b71
Update promotion-engine.json
vishak-udupa Apr 19, 2022
e9e35bc
fix conflicts
gracekarina May 10, 2022
1de79da
Merge pull request #9672 from hlyakhovich/issue-4883
gracekarina May 10, 2022
305249e
fix flatten option
frantuma May 31, 2022
d2a225f
Create swagger_orchestrator_sdk.sh
ankitverma659 Jun 7, 2022
32499fd
Create orchestrator.json
ankitverma659 Jun 7, 2022
7cfa8dd
Update swagger_orchestrator_sdk.sh
ankitverma659 Jun 7, 2022
c182f6d
Update swagger_orchestrator_sdk.sh
ankitverma659 Jun 7, 2022
37e8a2a
Update swagger_orchestrator_sdk.sh
ankitverma659 Jun 7, 2022
f7b6ae8
Update orchestrator.json
ankitverma659 Jun 7, 2022
748ee49
Update swagger_orchestrator_sdk.sh
ankitverma659 Jun 7, 2022
4bbc112
Update orchestrator.json
ankitverma659 Jun 7, 2022
02e8c83
Update swagger_orchestrator_sdk.sh
ankitverma659 Jun 7, 2022
1bc982a
Update orchestrator.json
ankitverma659 Jun 7, 2022
dca12cf
Update orchestrator.json
ankitverma659 Jun 7, 2022
a4ab5e2
Update orchestrator.json
ankitverma659 Jun 8, 2022
7f2abcb
UPDATED orchestrator.json
cap-prince-singh Jun 8, 2022
8832ced
Update orchestrator.json
cap-prince-singh Jun 13, 2022
c1c78a8
UPDATE orchestrator.json
cap-prince-singh Jun 23, 2022
5cb9075
UPDATE orchestrator.json
cap-prince-singh Jun 24, 2022
c749828
update orchestrator.json
cap-prince-singh Jul 6, 2022
a24b14b
polymorphism java tests
frantuma Jul 13, 2022
1807ac5
added composed schema extension for composed models founds
HugoMario Jul 13, 2022
b730d34
Merge pull request #11832 from swagger-api/polymorphism
HugoMario Jul 17, 2022
b30267e
updated java generators sample
HugoMario Jul 18, 2022
d6e3a9f
updated samples for jaxrs generators
HugoMario Jul 18, 2022
c3da1f0
updated samples for spring generators
HugoMario Jul 18, 2022
286d549
fixed generator service tests
HugoMario Jul 21, 2022
64e27b7
Merge pull request #11829 from swagger-api/oss-planning-612
HugoMario Jul 21, 2022
f63c349
prepare release 3.0.35
frantuma Aug 15, 2022
cc8f817
bump next snapshot 3.0.36-SNAPSHOT
frantuma Aug 16, 2022
9c7674a
updated jackson depdency in java samples
HugoMario Aug 24, 2022
f7dbdd0
Merge pull request #11881 from swagger-api/update-jackson-dependency-…
HugoMario Aug 24, 2022
bbb7f05
updated java samples affected by security issue
HugoMario Sep 17, 2022
462fd37
Merge pull request #11897 from swagger-api/swos-617
HugoMario Sep 18, 2022
d497dd8
Update orchestrator.json
omkrpt Sep 20, 2022
6aee1f4
updated csharp smaples with security dependency issue fixed
HugoMario Sep 21, 2022
2a8289e
Merge pull request #11902 from swagger-api/swos-618
HugoMario Sep 21, 2022
f81726f
bump snakeyaml to 1.33
frantuma Oct 4, 2022
b8a0085
updated csharp composed samples.
HugoMario Oct 4, 2022
d1d7c44
updated aspnetcore samples
HugoMario Oct 4, 2022
4e164f2
Merge pull request #11918 from swagger-api/codegen-generator-issue-1070
HugoMario Oct 4, 2022
d0a489b
prepare release 3.0.36
frantuma Nov 11, 2022
de22b2c
bump snapshot 3.0.37-SNAPSHOT
frantuma Nov 19, 2022
50f5b27
Update orchestrator.json
omkrpt Nov 23, 2022
dc99991
update generator docker base image to ubuntu:jammy
frantuma Dec 15, 2022
767bc30
Revert "update generator docker base image to ubuntu:jammy"
frantuma Dec 19, 2022
f32cdcf
copy GH test workflows to 3.0.0 branch
frantuma Jan 9, 2023
0a2fb7c
prepare release 3.0.37
frantuma Jan 19, 2023
8f191f4
bump snapshot 3.0.38-SNAPSHOT
frantuma Jan 19, 2023
f5f11b3
add ENV disableOas31Resolve to dockerfile
frantuma Jan 21, 2023
9784714
prepare release 3.0.38
frantuma Jan 22, 2023
ee2c5eb
next snapshot 3.0.39-SNAPSHOT
frantuma Jan 23, 2023
778513e
fix set-output in GH workflows
frantuma Jan 21, 2023
02a37a7
bump org.json:json and jersey versions (CVE-2022-45690, CVE-2021-28168)
frantuma Jan 24, 2023
344b287
prepare release 3.0.39
frantuma Jan 25, 2023
00dca4f
switch generator-v3 docker image to ubi-minimal jre-17
frantuma Jan 27, 2023
836666d
prepare release 3.0.40
frantuma Jan 27, 2023
124e9d6
initial PR pull GH action
frantuma Jan 30, 2023
8a3f888
docker release GH action
frantuma Jan 31, 2023
2ea66e8
docker release GH action logs
frantuma Jan 31, 2023
9fcc705
docker release GH action logs fix
frantuma Jan 31, 2023
b7752d3
docker release GH action debug
frantuma Jan 31, 2023
348559f
docker release GH action more logs
frantuma Feb 1, 2023
4d2c3b9
fix docker release GH action image push
frantuma Feb 1, 2023
659ee70
docker release GH action - deploy
frantuma Feb 1, 2023
6053015
handle generators snaps in release PRs
frantuma Feb 1, 2023
3bd450e
next snapshot 3.0.41-SNAPSHOT
frantuma Feb 2, 2023
0273b23
fix docker tag in GH Action
frantuma Feb 2, 2023
6306bbf
bump parser to 2.1.12
frantuma Feb 16, 2023
ed28322
prepare release 3.0.41
frantuma Feb 16, 2023
3e2211a
bump snapshot 3.0.42-SNAPSHOT
frantuma Feb 16, 2023
1cb0f36
JDK 11+ - update dependencies
frantuma Apr 5, 2023
b5eb665
prepare release 3.0.42
frantuma Apr 5, 2023
fe584f6
next snapshot 3.0.43-SNAPSHOT
frantuma Apr 6, 2023
fd072ea
fix push workflow
frantuma Apr 6, 2023
bceded4
fix push workflow
frantuma Apr 6, 2023
f40b97c
remove maven settings action from PR build workflow
frantuma Apr 24, 2023
de44d10
Update swagger-generator Dockerfile to install tar
dara-leonard Apr 21, 2023
e774827
Update Dockerfile_root to install tar
dara-leonard Apr 21, 2023
97a77e9
SWG-7517 updating the resolving options of swagger-parser-v3
May 4, 2023
21b55b1
updated spring-mvc samples
HugoMario May 11, 2023
fd37b94
Merge pull request #12144 from swagger-api/spring-mvc-sample-update
HugoMario May 11, 2023
97fc27e
SWG-7517 adding logic to unflattened case
May 12, 2023
445916c
SWG-7517 covering another case
May 12, 2023
c7a6849
Merge branch '3.0.0' into SWG-7517-updating-the-resolving-options-of-…
MiloszTarka May 12, 2023
ef05c09
Merge pull request #12140 from swagger-api/SWG-7517-updating-the-reso…
MiloszTarka May 12, 2023
ba1c3ac
prepare release 3.0.43
frantuma May 17, 2023
f535bec
next snapshot 3.0.44-SNAPSHOT
frantuma May 22, 2023
4c6170f
prepare release 3.0.44
frantuma May 23, 2023
3486e03
next snapshot 3.0.45-SNAPSHOT
frantuma May 23, 2023
51f1cb6
Create directory for custom codegen (#12167)
dara-leonard May 31, 2023
ea1d6e0
prepare release 3.0.45
frantuma Jun 2, 2023
de4cebb
Install gzip in swagger-generator Dockerfile
dara-leonard Jun 7, 2023
367f290
Update Dockerfile_root to install gzip
dara-leonard Jun 7, 2023
c6b5128
next snapshot 3.0.46-SNAPSHOT
frantuma Jun 7, 2023
336106b
prepare release 3.0.46
frantuma Jun 7, 2023
76bb54a
12135 - Upgrading slf4j to latest
jeremydyoung Jul 7, 2023
3da75f2
Merge pull request #12194 from jeremydyoung/logging-fix-12135
HugoMario Jul 8, 2023
06d4837
bump to 3.0.47-SNAPSHOT version
HugoMario Aug 17, 2023
24b9267
Merge pull request #12216 from swagger-api/bump-to-next-snapshot
HugoMario Aug 17, 2023
5795091
updated swagger-codegen-generators version
HugoMario Aug 18, 2023
feb4646
Merge pull request #12217 from swagger-api/update-codegen-generator-d…
HugoMario Aug 18, 2023
be0212a
prepare release 3.0.47
frantuma Oct 2, 2023
9f9fd75
update dependencies
frantuma Oct 19, 2023
db6e53b
prepare release 3.0.48
frantuma Oct 19, 2023
05fb65e
update swagger-generator docker image to 9.2
frantuma Oct 23, 2023
2f0dac2
prepare release 3.0.49
frantuma Oct 23, 2023
2d7f4ee
update dependencies
frantuma Oct 23, 2023
8c0a22a
escape quotes in paths
frantuma Oct 25, 2023
7422c2e
bump next snapshot 3.0.50-SNAPSHOT
frantuma Oct 25, 2023
87ad143
prepare release 3.0.50
frantuma Oct 25, 2023
6841e15
Merge branch 'Issue-8412' of https://github.com/douglasbgray/swagger-…
HugoMario Oct 26, 2023
a1ba22c
added default port for server var
HugoMario Oct 26, 2023
2ece4c0
Merge pull request #12259 from swagger-api/douglasbgray-Issue-8412
HugoMario Oct 26, 2023
1b3504c
bump codegen v1 to 2.4.35
frantuma Oct 26, 2023
fc4e952
bump codegen v1 to 2.4.36
frantuma Oct 26, 2023
7c0854d
bump to 3.0.51-SNAPSHOT
HugoMario Oct 29, 2023
2a9de67
Merge pull request #12268 from swagger-api/bump-to-3.0.51-snapshot
HugoMario Oct 29, 2023
4b35a00
bump swagger codegen generators dependency to next snapshot
HugoMario Oct 31, 2023
d721ab7
Merge pull request #12269 from swagger-api/update-generators-dependency
HugoMario Oct 31, 2023
511d755
update auth values in openapi document
HugoMario Nov 8, 2023
57a098a
Merge pull request #12273 from swagger-api/auth-value-update
HugoMario Nov 8, 2023
d1e6e35
prepare release 3.0.51
frantuma Nov 22, 2023
a9c3cd3
bump snapshot 3.0.52-SNAPSHOT
frantuma Nov 24, 2023
6d29bf4
new attribute isJson issue 1173 swagger-codegen-generators
Nov 24, 2023
a14a38f
Update cli docker to eclipse-temurin:17-jre-alpine
daveset Oct 27, 2023
1aabcd7
implement multi-platform docker images
frantuma Nov 30, 2023
b67b9c2
fix multi-platform docker images
frantuma Nov 30, 2023
a3b4603
Merge branch '3.0.0' into issue-1173-generators
HugoMario Dec 3, 2023
375d7b6
Merge pull request #12289 from luca-vercelli/issue-1173-generators
HugoMario Dec 3, 2023
8f0169e
subtypeName for java interface discriminator
OsztosA Dec 3, 2023
a7cdf59
Merge branch '3.0.0' into feature/java-interface-discriminator-helper
OsztosA Dec 3, 2023
88e4002
fix issue 804 - java discriminator
OsztosA Dec 9, 2023
6769e30
Merge pull request #12302 from OsztosA/feature/java-interface-discrim…
HugoMario Dec 14, 2023
eda6024
update dependencies
frantuma Jan 3, 2024
5da2449
prepare release 3.0.52
frantuma Jan 3, 2024
d6d68bf
nxt snap 3.0.53-SNAPSHOT
frantuma Jan 4, 2024
25cc058
implement /model endpoint returning intermediate model
frantuma Jan 24, 2024
d0db2bc
allow custom codegen generator be loaded
HugoMario Feb 5, 2024
f999115
Merge pull request #12333 from swagger-api/custom-generator-load
HugoMario Feb 5, 2024
08c77e9
prepare release 3.0.53
frantuma Feb 14, 2024
0c2837e
Update docker-release-3.0.yml
qhaas Feb 5, 2024
9372716
implement render endpoint
frantuma Feb 19, 2024
428ac06
bump snapshot 3.0.54-SNAPSHOT
frantuma Feb 19, 2024
1292350
prepare release 3.0.54
frantuma Feb 19, 2024
d997887
bump 3.0.55-SNAPSHOT
frantuma Apr 21, 2024
10ca500
prepare release 3.0.55
frantuma Apr 22, 2024
f32307f
bump 3.0.56-SNAPSHOT
frantuma Apr 22, 2024
127bec0
changed stage url (#8)
MeghanaCAP Apr 29, 2024
c9ec680
Update swagger-generators version to 1.0.49-SNAP and generated Csharp…
micryc May 8, 2024
cd3dd22
Merge pull request #12394 from swagger-api/Bump-Generators-version
micryc May 8, 2024
0693828
prepare release 3.0.56
frantuma May 10, 2024
f265b62
bump 3.0.57-SNAPSHOT
frantuma May 11, 2024
d8a6194
prepare release 3.0.57
frantuma May 27, 2024
6e71542
next snapshot 3.0.58-SNAPSHOT
frantuma May 28, 2024
2a08ba5
update dependencies
frantuma Jul 8, 2024
2768e05
prepare release 3.0.58
frantuma Jul 8, 2024
5c88061
implement config priorities
frantuma Jul 22, 2024
1fec791
bump snapshot 3.0.59-SNAPSHOT
frantuma Jul 22, 2024
e41cdbf
prepare release 3.0.59
frantuma Jul 22, 2024
946499a
bump codgen v2 - prepare release 3.0.60
frantuma Aug 1, 2024
c00a588
bump 3.0.61-SNAPSHOT
frantuma Aug 9, 2024
b953e97
prepare release 3.0.61
frantuma Aug 9, 2024
31a6918
bump snapshot 3.0.62-SNAPSHOT
frantuma Aug 20, 2024
aa915ae
update deps
frantuma Aug 20, 2024
0ad096f
add schemaType to CodegenProperty
frantuma Aug 26, 2024
60322d6
prepare release 3.0.62
frantuma Aug 27, 2024
1b75eec
chore(repo): simplify ReadMe and docs for 3.X
frankkilcommins Oct 15, 2024
6ce443a
update dependencies
frantuma Oct 15, 2024
7bf322c
prepare release 3.0.63
frantuma Oct 16, 2024
a531639
update dependencies
frantuma Oct 16, 2024
e06aaa1
bump snapshot 3.0.64-SNAPSHOT
frantuma Oct 16, 2024
64bd403
chore(repo): fix documentation typos
frantuma Oct 17, 2024
d6deb22
Update workflow-integration.md
ponelat Oct 25, 2024
11553dd
Merge pull request #12485 from swagger-api/fix/broken-link-in-workflo…
micryc Oct 28, 2024
3b9e045
add configFiles generation
frantuma Nov 4, 2024
d8aa446
prepare release 3.0.64
frantuma Nov 7, 2024
dd7f8f4
bump snapshot 3.0.65-SNAPSHOT
frantuma Nov 8, 2024
444c9d3
try jsvt build for swagger
devansh-singh2351 Nov 27, 2024
de3f262
try jsvt build for swagger
devansh-singh2351 Nov 27, 2024
1d1f9fd
--
devansh-singh2351 Nov 27, 2024
10c58a0
--
devansh-singh2351 Nov 27, 2024
86a2f4b
--
devansh-singh2351 Nov 28, 2024
fd3a793
--
devansh-singh2351 Nov 28, 2024
8b4ace4
--
devansh-singh2351 Nov 28, 2024
e8934db
--
devansh-singh2351 Nov 28, 2024
bf20a7d
--
devansh-singh2351 Nov 28, 2024
6a78892
--
devansh-singh2351 Nov 28, 2024
83c1ff9
--
devansh-singh2351 Nov 28, 2024
a4ee1e6
--
devansh-singh2351 Nov 28, 2024
9a63fed
--
devansh-singh2351 Nov 28, 2024
dc7efae
--
devansh-singh2351 Nov 28, 2024
d84e61e
--
devansh-singh2351 Nov 28, 2024
e95f47e
--
devansh-singh2351 Nov 28, 2024
20521c5
--
devansh-singh2351 Nov 28, 2024
6d0dfaf
--
devansh-singh2351 Nov 28, 2024
fefa31e
--
devansh-singh2351 Nov 28, 2024
0dcac8f
--
devansh-singh2351 Nov 28, 2024
75cf5ae
--
devansh-singh2351 Nov 28, 2024
7e5a962
--
devansh-singh2351 Nov 28, 2024
8fc272f
--
devansh-singh2351 Nov 28, 2024
ca5ee51
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
642500f
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
11e88d5
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
a9a94b2
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
5d9246f
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
20cdff0
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
e4bda4f
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
ef59711
upgrade to swagger 3 for sdk
devansh-singh2351 Nov 28, 2024
bf4c865
--
devansh-singh2351 Nov 28, 2024
be670b7
--
devansh-singh2351 Nov 28, 2024
de519f5
--
devansh-singh2351 Nov 29, 2024
6e305ab
Merge remote-tracking branch 'upstream/3.0.0' into swagger_build_for_…
devansh-singh2351 Nov 29, 2024
3ae21b6
--
devansh-singh2351 Nov 29, 2024
63db68d
--
devansh-singh2351 Nov 29, 2024
cfa5e69
--
devansh-singh2351 Nov 29, 2024
315b023
--
devansh-singh2351 Nov 29, 2024
420a3de
--
devansh-singh2351 Nov 29, 2024
f948c40
--
devansh-singh2351 Nov 29, 2024
35bd25f
--
devansh-singh2351 Nov 29, 2024
20975e9
--
devansh-singh2351 Nov 29, 2024
a2bbd0b
--
devansh-singh2351 Nov 29, 2024
30c62b0
--
devansh-singh2351 Nov 29, 2024
541cf47
--
devansh-singh2351 Nov 29, 2024
d4c10a6
--
devansh-singh2351 Nov 29, 2024
0ea20b0
--
devansh-singh2351 Nov 29, 2024
79d5660
--
devansh-singh2351 Nov 29, 2024
68fc1b7
--
devansh-singh2351 Nov 29, 2024
d1bf37e
--
devansh-singh2351 Nov 29, 2024
10d6ff7
--
devansh-singh2351 Nov 29, 2024
f7add32
--
devansh-singh2351 Nov 29, 2024
f9b8b24
--
devansh-singh2351 Nov 29, 2024
ee58f17
--
devansh-singh2351 Nov 29, 2024
b044658
--
devansh-singh2351 Nov 29, 2024
d6d7502
--
devansh-singh2351 Nov 29, 2024
535fa4c
--
devansh-singh2351 Nov 29, 2024
f547a99
--
devansh-singh2351 Nov 29, 2024
f898716
--
devansh-singh2351 Nov 29, 2024
f5a7238
--
devansh-singh2351 Nov 29, 2024
996d68e
--
devansh-singh2351 Nov 29, 2024
1bc92b0
--
devansh-singh2351 Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
48 changes: 48 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Builder'
description: 'build project'
inputs:
path:
description: 'project root path'
required: true
job-name:
description: 'Job name'
required: true
build-commands:
description: 'Build Commands'
required: true
outputs:
logs:
description: "logs"
value: ${{ steps.build.outputs.logs }}
path:
description: "output path"
value: ${{ steps.build.outputs.path }}
runs:
using: "composite"
steps:
- id: build
name: build
run: |
buildlogfile=${{ inputs.job-name }}-build.log
echo "path=$(echo generated/${{ inputs.job-name }})" >> $GITHUB_OUTPUT
curdir=$(pwd)
echo -e "\n****** BUILD ******\n" >> $curdir/$buildlogfile
cd ${{ inputs.path }}
echo -e "${{ inputs.build-commands }}" > $curdir/buildcommands.log
echo "logs=$(echo $curdir/$buildlogfile)" >> $GITHUB_OUTPUT
buildcommands=$(cat $curdir/buildcommands.log)

while [ "$buildcommands" ] ;do
iter=${buildcommands%%__&&__*}
echo -e "\n****** executing: $iter ******\n"
echo -e "\n****** executing: $iter ******\n" >> $curdir/$buildlogfile
$iter 2>&1 | tee --append $curdir/$buildlogfile
[ "$buildcommands" = "$iter" ] && \
buildcommands='' || \
buildcommands="${buildcommands#*__&&__}"
done
echo -e "\n****** executed all buildcommands ******\n"
echo -e "\n****** executed all buildcommand ******\n" >> $curdir/$buildlogfile
cd ${curdir}
echo "logs=$(echo $curdir/$buildlogfile)" >> $GITHUB_OUTPUT
shell: bash
39 changes: 39 additions & 0 deletions .github/actions/generate/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Generate'
description: 'codegen generate'
inputs:
spec-url:
description: 'Url of the openapi definition'
required: true
default: 'https://petstore3.swagger.io/api/v3/openapi.json'
language:
description: 'Language to generate'
required: true
job-name:
description: 'Job name'
required: true
options:
description: 'Language Options'
required: false
default: ""
outputs:
logs:
description: "logs"
value: ${{ steps.generate.outputs.logs }}
path:
description: "output path"
value: ${{ steps.generate.outputs.path }}
runs:
using: "composite"
steps:
- id: generate
name: generate
run: |
logfile=${{ inputs.job-name }}.log
chmod +x ${{ github.action_path }}/generate.sh
echo "${{ inputs.language }} ${{ inputs.job-name }} ${{ inputs.spec-url }} ${{ inputs.options }}"
echo -e "\n****** generate ******\n" > $logfile
echo "logs=$(echo $logfile)" >> $GITHUB_OUTPUT
${{ github.action_path }}/generate.sh ${{ inputs.language }} ${{ inputs.job-name }} ${{ inputs.spec-url }} ${{ inputs.options }} 2>&1 | tee --append $logfile
echo "path=$(echo generated/${{ inputs.job-name }})" >> $GITHUB_OUTPUT
echo "logs=$(echo $logfile)" >> $GITHUB_OUTPUT
shell: bash
51 changes: 51 additions & 0 deletions .github/actions/generate/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

SCRIPT="$0"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done


executable="swagger-codegen-cli.jar"

LANG=$1

echo "LANGUAGE $LANG"

JOB_NAME=$2

echo "JOB_NAME $JOB_NAME"

if [ -z "$JOB_NAME" ]
then
JOB_NAME=$LANG
fi

SPEC_URL=$3

echo "SPEC_URL PARAM $SPEC_URL"

if [[ $SPEC_URL == "null" ]];
then
SPEC_URL="https://petstore3.swagger.io/api/v3/openapi.json"
fi

echo "SPEC_URL $SPEC_URL"

shift;
shift;
shift;

export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=$SCRIPT/logback.xml"
ags="generate -i ${SPEC_URL} -l ${LANG} -o generated/${JOB_NAME} $@"

java $JAVA_OPTS -jar $executable $ags


12 changes: 12 additions & 0 deletions .github/actions/generate/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="io.swagger" level="debug"/>
<root level="debug">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
16 changes: 16 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
fail-on-severity: high
216 changes: 216 additions & 0 deletions .github/workflows/docker-release-3.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
name: Build And Push Docker Release 3.0

on:
workflow_dispatch:
branches: [ "3.0.0" ]
inputs:
tag:
description: tag/version to release
required: true
jobs:
build_push_docker_release_30:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: git checkout 3.0.0
with:
ref: 3.0.0
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: preliminary checks
run: |
docker login --username=${{ secrets.DOCKERHUB_SB_USERNAME }} --password=${{ secrets.DOCKERHUB_SB_PASSWORD }}
set -e
# fail if templates/generators contain carriage return '\r'
/bin/bash ./bin/utils/detect_carriage_return.sh
# fail if generators contain merge conflicts
/bin/bash ./bin/utils/detect_merge_conflict.sh
# fail if generators contain tab '\t'
/bin/bash ./bin/utils/detect_tab_in_java_class.sh
- uses: s4u/[email protected]
name: setup maven settings.xml
with:
servers: |
[{
"id": "sonatype-nexus-staging",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
},
{
"id": "sonatype-nexus-snapshots",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
}]
- name: Build with Maven
run: |
mvn clean install -U -Pdocker -DJETTY_TEST_HTTP_PORT=8090 -DJETTY_TEST_STOP_PORT=8089
- name: docker generator build and push
uses: docker/build-push-action@v5
with:
context: ./modules/swagger-generator
file: ./modules/swagger-generator/Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
provenance: false
build-args: |
HIDDEN_OPTIONS_DEFAULT_PATH=hiddenOptions.yaml
JAVA_MEM=1024m
HTTP_PORT=8080
tags: swaggerapi/swagger-generator-v3:latest,swaggerapi/swagger-generator-v3:${{ env.TAG }}
- name: docker generator root build and push
uses: docker/build-push-action@v5
with:
context: ./modules/swagger-generator
file: ./modules/swagger-generator/Dockerfile_root
push: true
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
provenance: false
build-args: |
HIDDEN_OPTIONS_DEFAULT_PATH=hiddenOptions.yaml
JAVA_MEM=1024m
HTTP_PORT=8080
tags: swaggerapi/swagger-generator-v3-root:latest,swaggerapi/swagger-generator-v3-root:${{ env.TAG }},swaggerapi/swagger-generator-v3:${{ env.TAG }}-root
- name: docker cli build and push
uses: docker/build-push-action@v5
with:
context: ./modules/swagger-codegen-cli
file: ./modules/swagger-codegen-cli/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
provenance: false
tags: swaggerapi/swagger-codegen-cli-v3:latest,swaggerapi/swagger-codegen-cli-v3:${{ env.TAG }}
- name: docker minimal build and push
uses: docker/build-push-action@v5
with:
context: ./modules/swagger-generator
file: ./modules/swagger-generator/Dockerfile_minimal
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
provenance: false
tags: swaggerapi/swagger-generator-v3-minimal:latest,swaggerapi/swagger-generator-v3-minimal:${{ env.TAG }}
- name: deploy
run: |
echo "${{ env.TAG }}"

TOKEN="${{ secrets.RANCHER2_BEARER_TOKEN }}"
RANCHER_HOST="rancher.tools.swagger.io"
CLUSTER_ID="c-n8zp2"
NAMESPACE_NAME="swagger-oss"
K8S_OBJECT_TYPE="daemonsets"
K8S_OBJECT_NAME="swagger-generator-v3"
DEPLOY_IMAGE="swaggerapi/swagger-generator-v3:${{ env.TAG }}"

workloadStatus=""
getStatus() {
echo "Getting update status..."
if ! workloadStatus="$(curl -s -X GET \
-H "Authorization: Bearer ${TOKEN}" \
-H 'Content-Type: application/json' \
"https://${RANCHER_HOST}/k8s/clusters/${CLUSTER_ID}/apis/apps/v1/namespaces/${NAMESPACE_NAME}/${K8S_OBJECT_TYPE}/${K8S_OBJECT_NAME}/status")"
then
echo 'ERROR - get status k8s API call failed!'
echo "Exiting build"...
exit 1
fi
}

# $1 = image to deploy
updateObject() {
local image="${1}"
echo "Updating image value..."

if ! curl -s -X PATCH \
-H "Authorization: Bearer ${TOKEN}" \
-H 'Content-Type: application/json-patch+json' \
"https://${RANCHER_HOST}/k8s/clusters/${CLUSTER_ID}/apis/apps/v1/namespaces/${NAMESPACE_NAME}/${K8S_OBJECT_TYPE}/${K8S_OBJECT_NAME}" \
-d "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/image\", \"value\": \"${image}\"}]"
then
echo 'ERROR - image update k8s API call failed!'
echo "Exiting build..."
exit 1
fi
}


# Check that the TAG is valid
if [[ ${{ env.TAG }} =~ ^[vV]?[0-9]*\.[0-9]*\.[0-9]*$ ]]; then
echo ""
echo "This is a Valid TAG..."

# Get current image/tag in case we need to rollback
getStatus
ROLLBACK_IMAGE="$(echo "${workloadStatus}" | jq -r '.spec.template.spec.containers[0].image')"
echo ""
echo "Current image: ${ROLLBACK_IMAGE}"

# Update image and validate response
echo ""
updateObject "${DEPLOY_IMAGE}"
echo ""

echo ""
echo "Waiting for pods to start..."
echo ""
sleep 60s

# Get state of the k8s object. If numberReady == desiredNumberScheduled, consider the upgrade successful. Else raise error
getStatus
status="$(echo "${workloadStatus}" | jq '.status')"
echo ""
echo "${status}"
echo ""

numberDesired="$(echo "${status}" | jq -r '.desiredNumberScheduled')"
numberReady="$(echo "${status}" | jq -r '.numberReady')"

if (( numberReady == numberDesired )); then
echo "${K8S_OBJECT_NAME} has been upgraded to ${DEPLOY_IMAGE}"

# If pods are not starting, rollback the upgrade and exit the build with error
else
echo "state = error...rolling back upgrade"
updateObject "${ROLLBACK_IMAGE}"
echo ""

echo ""
echo "Waiting for rollback pods to start..."
echo ""
sleep 60s

getStatus
status="$(echo "${workloadStatus}" | jq '.status')"
echo ""
echo "${status}"
echo ""

numberDesired="$(echo "${status}" | jq -r '.desiredNumberScheduled')"
numberReady="$(echo "${status}" | jq -r '.numberReady')"

if (( numberReady == numberDesired )); then
echo "Rollback to ${ROLLBACK_IMAGE} completed."
else
echo "FATAL - rollback failed"
fi
echo "Exiting Build..."
exit 1
fi

else
echo "This TAG is not in a valid format..."
echo "Exiting Build..."
exit 0
fi
echo "Exiting Build..."
exit 0
env:
TAG: ${{ github.event.inputs.tag }}
Loading