Skip to content

Commit b2bfad9

Browse files
authored
Merge pull request #6 from OpenAPITools/master
merge original
2 parents 1fb2e4f + 41f586b commit b2bfad9

File tree

7,980 files changed

+176224
-86520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,980 files changed

+176224
-86520
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
- ~/.bundle
8383
- ~/.go_workspace
8484
- ~/.gradle
85+
- ~/.pub-cache
8586
- ~/.cache/bower
8687
- ".git"
8788
- ~/.stack

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/check-supported-versions.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
with:
2929
java-version: ${{ matrix.java }}
3030

31-
- uses: actions/cache@v1
31+
- uses: actions/cache@v2.1.4
3232
with:
3333
path: ~/.m2/repository
3434
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
3535
restore-keys: |
3636
${{ runner.os }}-maven-
3737
38-
- uses: actions/cache@v2
38+
- uses: actions/cache@v2.1.4
3939
with:
4040
path: |
4141
~/.gradle/caches
@@ -49,7 +49,7 @@ jobs:
4949
run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }}
5050

5151
- name: Upload Maven build artifact
52-
uses: actions/upload-artifact@v1
52+
uses: actions/upload-artifact@v2.2.2
5353
if: matrix.java == '8' && matrix.os == 'ubuntu-latest'
5454
with:
5555
name: artifact
@@ -80,7 +80,7 @@ jobs:
8080
- name: Check out code
8181
uses: actions/checkout@v2
8282
- name: Download build artifact
83-
uses: actions/download-artifact@v1
83+
uses: actions/download-artifact@v2.0.8
8484
with:
8585
name: artifact
8686
- name: Run Ensures Script

.github/workflows/sonar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111

1212
runs-on: ubuntu-latest
13-
13+
if: ${{ github.repository_owner == 'OpenAPITools' }}
1414
steps:
1515
- uses: actions/checkout@v1
1616
- name: Set up JDK 11

.travis.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ addons:
6262
- petstore.swagger.io
6363

6464
before_install:
65+
- sudo rm -rf /var/lib/apt/lists/*
66+
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
67+
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
68+
- sudo apt-get update
69+
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
70+
- mkdir -vp ~/.docker/cli-plugins/
71+
- curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
72+
- chmod a+x ~/.docker/cli-plugins/docker-buildx
6573
# to run petstore server locally via docker
6674
- echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin || true
6775
- docker pull swaggerapi/petstore
@@ -149,6 +157,10 @@ install:
149157
script:
150158
# fail fast
151159
- set -e
160+
# show docker buildx version
161+
- docker buildx version
162+
# fail if the template files contains tabs
163+
- /bin/bash ./bin/utils/detect_tab_in_templates.sh
152164
# fail if the test files have changes
153165
- bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml
154166
# fail if templates/generators contain carriage return '\r'
@@ -197,12 +209,14 @@ after_success:
197209
echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin;
198210
export cli_version=$(\mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[');
199211
export build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ");
200-
docker build --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online;
212+
docker buildx create --use;
201213
if [ ! -z "$TRAVIS_TAG" ]; then
202-
docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG;
214+
docker buildx build --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME:latest -t $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online;
215+
echo "Built and tagged $DOCKER_GENERATOR_IMAGE_NAME";
203216
fi;
204-
if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then
205-
docker push $DOCKER_GENERATOR_IMAGE_NAME && echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME";
217+
if [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
218+
docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online;
219+
echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME for master";
206220
fi;
207221
fi;
208222
## docker: build cli image and push to Docker Hub
@@ -211,12 +225,14 @@ after_success:
211225
cp docker-entrypoint.sh ./modules/openapi-generator-cli;
212226
export cli_version=$(\mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[');
213227
export build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ");
214-
docker build --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli;
228+
docker buildx create --use;
229+
docker buildx build --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli;
215230
if [ ! -z "$TRAVIS_TAG" ]; then
216-
docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG;
231+
docker buildx build --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli;
232+
echo "Built and tagged $DOCKER_GENERATOR_IMAGE_NAME";
217233
fi;
218-
if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then
219-
docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME;
234+
if [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
235+
docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$TRAVIS_COMMIT --label=org.opencontainers.image.version=$cli_version -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli;
220236
echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME";
221237
fi;
222238
fi;

CI/circle_parallel.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ function cleanup {
1414

1515
trap cleanup EXIT
1616

17+
function installDart {
18+
# install dart2
19+
sudo apt-get update
20+
sudo apt-get install apt-transport-https
21+
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
22+
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
23+
sudo apt-get update
24+
sudo apt-get install dart
25+
export PATH="$PATH:/usr/lib/dart/bin"
26+
}
27+
1728
if [ "$NODE_INDEX" = "1" ]; then
1829
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
1930
java -version
@@ -24,6 +35,8 @@ if [ "$NODE_INDEX" = "1" ]; then
2435
ls -l /home/circleci/.ivy2/cache
2536

2637
elif [ "$NODE_INDEX" = "2" ]; then
38+
installDart
39+
2740
# run ensure-up-to-date sample script on SNAPSHOT version only
2841
project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
2942
if [[ $project_version == *"-SNAPSHOT" ]]; then
@@ -67,15 +80,6 @@ else
6780
export PATH="/usr/local/go1.14/go/bin:$PATH"
6881
go version
6982

70-
# install dart2
71-
sudo apt-get update
72-
sudo apt-get install apt-transport-https
73-
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
74-
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
75-
sudo apt-get update
76-
sudo apt-get install dart
77-
export PATH="$PATH:/usr/lib/dart/bin"
78-
7983
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error
8084
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
8185
fi

0 commit comments

Comments
 (0)