2016-01-05 04:25:45 +00:00
|
|
|
sudo: required
|
2014-09-19 21:38:00 +00:00
|
|
|
language: java
|
|
|
|
jdk:
|
2016-01-05 20:29:48 +00:00
|
|
|
- oraclejdk7
|
2016-01-07 21:01:22 +00:00
|
|
|
- oraclejdk8
|
2016-01-06 17:31:06 +00:00
|
|
|
|
2016-07-15 01:57:24 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.m2
|
2017-03-12 16:52:10 +00:00
|
|
|
- $HOME/.ivy2
|
2017-03-21 13:48:40 +00:00
|
|
|
- $HOME/.gradle/caches/
|
|
|
|
- $HOME/.gradle/wrapper/
|
2017-03-11 08:59:17 +00:00
|
|
|
- $HOME/samples/client/petstore/php/SwaggerClient-php/vendor
|
|
|
|
- $HOME/samples/client/petstore/ruby/venodr/bundle
|
|
|
|
- $HOME/samples/client/petstore/python/.venv/
|
|
|
|
- $HOME/samples/client/petstore/typescript-node/npm/node_modules
|
|
|
|
- $HOME/samples/client/petstore/typescript-node/npm/typings/
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/tests/default/typings
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/default/typings
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules
|
|
|
|
- $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings
|
|
|
|
- $HOME/samples/client/petstore/typescript-angular/node_modules
|
|
|
|
- $HOME/samples/client/petstore/typescript-angular/typings
|
2016-07-15 01:57:24 +00:00
|
|
|
|
2016-01-05 12:08:52 +00:00
|
|
|
services:
|
|
|
|
- docker
|
2016-01-06 17:31:06 +00:00
|
|
|
|
2016-07-19 14:36:10 +00:00
|
|
|
addons:
|
|
|
|
hosts:
|
|
|
|
- petstore.swagger.io
|
|
|
|
|
2016-01-05 12:08:52 +00:00
|
|
|
before_install:
|
|
|
|
# required when sudo: required for the Ruby petstore tests
|
|
|
|
- gem install bundler
|
2016-05-20 06:15:04 +00:00
|
|
|
- npm install -g typescript
|
2016-06-11 02:38:22 +00:00
|
|
|
- sudo pip install virtualenv
|
2016-07-19 14:36:10 +00:00
|
|
|
# to run petstore server locally via docker
|
|
|
|
- docker pull swaggerapi/petstore
|
|
|
|
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
|
|
|
- docker ps -a
|
2017-01-12 08:48:25 +00:00
|
|
|
# Add bats test framework and cURL for Bash script integration tests
|
|
|
|
- sudo add-apt-repository ppa:duggan/bats --yes
|
|
|
|
- sudo apt-get update -qq
|
|
|
|
- sudo apt-get install -qq bats
|
|
|
|
- sudo apt-get install -qq curl
|
|
|
|
|
2016-07-19 14:36:10 +00:00
|
|
|
# show host table to confirm petstore.swagger.io is mapped to localhost
|
|
|
|
- cat /etc/hosts
|
2017-03-21 13:48:40 +00:00
|
|
|
# show java version
|
|
|
|
- java -version
|
2016-01-06 17:31:06 +00:00
|
|
|
|
2016-01-05 12:08:52 +00:00
|
|
|
install:
|
2016-07-27 08:19:23 +00:00
|
|
|
# Add Godeps dependencies to GOPATH and PATH
|
2016-08-10 07:34:48 +00:00
|
|
|
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
|
2016-07-27 08:19:23 +00:00
|
|
|
- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace"
|
|
|
|
- export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH"
|
2016-01-06 17:31:06 +00:00
|
|
|
|
2016-01-05 04:25:45 +00:00
|
|
|
script:
|
2017-01-09 10:29:41 +00:00
|
|
|
# fail fast
|
|
|
|
- set -e
|
|
|
|
# fail if templates/generators contain carriage return '\r'
|
|
|
|
- /bin/bash ./bin/utils/detect_carriage_return.sh
|
|
|
|
# fail if generators contain tab '\t'
|
|
|
|
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
|
|
|
|
# run integration tests defined in maven pom.xml
|
2017-04-24 08:36:32 +00:00
|
|
|
- mvn -q --batch-mode verify -Psamples
|
2017-03-12 09:09:47 +00:00
|
|
|
# docker: build generator image and push to Docker Hub
|
|
|
|
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi
|
|
|
|
# docker: build cli image and push to Docker Hub
|
|
|
|
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi
|
2016-01-06 17:31:06 +00:00
|
|
|
|
2016-01-05 04:25:45 +00:00
|
|
|
env:
|
2017-03-12 09:09:47 +00:00
|
|
|
- DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli
|