2018-06-17 06:52:37 +00:00
version : 2
jobs :
build :
2018-07-20 10:45:14 +00:00
# docker:
# #- image: openapitools/openapi-generator
# - image: swaggerapi/petstore
# environment:
# SWAGGER_HOST=http://petstore.swagger.io
# SWAGGER_BASE_PATH=/v2
2018-06-17 06:52:37 +00:00
machine :
docker_layer_caching : true
working_directory : ~/OpenAPITools/openapi-generator
2018-08-31 07:16:41 +00:00
parallelism : 3
2018-06-17 06:52:37 +00:00
shell : /bin/bash --login
environment :
CIRCLE_ARTIFACTS : /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
DOCKER_GENERATOR_IMAGE_NAME : openapitools/openapi-generator
DOCKER_CODEGEN_CLI_IMAGE_NAME : openapitools/openapi-generator-cli
steps :
2018-07-12 05:16:33 +00:00
# Restore the dependency cache
- restore_cache :
keys :
# Default branch if not
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
2018-06-17 06:52:37 +00:00
# Machine Setup
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
- checkout
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
# In many cases you can simplify this from what is generated here.
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
- run : mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
# This is based on your 1.0 configuration file or project settings
- run :
command : sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV
- run :
command : 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
- run :
command : |-
printf '127.0.0.1 petstore.swagger.io
' | sudo tee -a /etc/hosts
# Dependencies
2018-07-03 09:55:26 +00:00
# Install latest stable node for angular 6
- run :
name : Install node@stable (for angular 6)
command : |
set +e
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install stable
nvm alias default stable
# Each step uses the same `$BASH_ENV`, so need to modify it
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
- run : node --version
2018-06-17 06:52:37 +00:00
# - run: docker pull openapitools/openapi-petstore
# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore
- run : docker pull swaggerapi/petstore
- run : docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- run : docker ps -a
- run : sleep 30
- run : cat /etc/hosts
2018-07-12 05:16:33 +00:00
# Test
- run : mvn --quiet clean install
2018-07-20 10:45:14 +00:00
- run : ./CI/circle_parallel.sh
2018-06-17 06:52:37 +00:00
# Save dependency cache
- save_cache :
2018-07-12 05:16:33 +00:00
key : source-v1-{{ .Branch }}-{{ .Revision }}
2018-06-17 06:52:37 +00:00
paths :
# This is a broad list of cache paths to include many possible development environments
# You can probably delete some of these entries
- vendor/bundle
- ~/virtualenvs
- ~/.m2
- ~/.ivy2
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.cache/bower
2018-07-12 05:16:33 +00:00
- ".git"
2019-02-24 03:19:09 +00:00
- ~/.stack
2018-06-17 06:52:37 +00:00
# Teardown
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# Save test results
- store_test_results :
path : /tmp/circleci-test-results
# Save artifacts
- store_artifacts :
path : /tmp/circleci-artifacts
- store_artifacts :
path : /tmp/circleci-test-results