|
1 |
| -version: 2 |
| 1 | +version: 2.1 |
| 2 | +commands: # a reusable command with parameters |
| 3 | + command_build_and_test: |
| 4 | + parameters: |
| 5 | + nodeNo: |
| 6 | + default: "0" |
| 7 | + type: string |
| 8 | + steps: |
| 9 | + # Restore the dependency cache |
| 10 | + - restore_cache: |
| 11 | + keys: |
| 12 | + # Default branch if not |
| 13 | + - source-v2-{{ .Branch }}-{{ .Revision }} |
| 14 | + - source-v2-{{ .Branch }}- |
| 15 | + - source-v2- |
| 16 | + # Machine Setup |
| 17 | + # 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 |
| 18 | + - run: |
| 19 | + name: Install Headless Chrome dependencies |
| 20 | + command: | |
| 21 | + sudo apt-get update && sudo apt-get install -yq \ |
| 22 | + gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ |
| 23 | + libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ |
| 24 | + libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \ |
| 25 | + libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates \ |
| 26 | + fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm1 |
| 27 | + # 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. |
| 28 | + - checkout |
| 29 | + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. |
| 30 | + # In many cases you can simplify this from what is generated here. |
| 31 | + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' |
| 32 | + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS |
| 33 | + # This is based on your 1.0 configuration file or project settings |
| 34 | + - run: |
| 35 | + 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 |
| 36 | + - run: |
| 37 | + command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' |
| 38 | + - run: |
| 39 | + command: |- |
| 40 | + printf '127.0.0.1 petstore.swagger.io |
| 41 | + ' | sudo tee -a /etc/hosts |
| 42 | + # - run: docker pull openapitools/openapi-petstore |
| 43 | + # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore |
| 44 | + - run: docker pull swaggerapi/petstore |
| 45 | + - run: docker run --name petstore.swagger -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore |
| 46 | + - run: docker ps -a |
| 47 | + - run: sleep 30 |
| 48 | + - run: cat /etc/hosts |
| 49 | + # Test |
| 50 | + - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error |
| 51 | + - run: |
| 52 | + name: "Setup custom environment variables" |
| 53 | + command: echo 'export CIRCLE_NODE_INDEX="<<parameters.nodeNo>>"' >> $BASH_ENV |
| 54 | + - run: ./CI/circle_parallel.sh |
| 55 | + # Save dependency cache |
| 56 | + - save_cache: |
| 57 | + key: source-v2-{{ .Branch }}-{{ .Revision }} |
| 58 | + paths: |
| 59 | + # This is a broad list of cache paths to include many possible development environments |
| 60 | + # You can probably delete some of these entries |
| 61 | + - vendor/bundle |
| 62 | + - ~/.nvm |
| 63 | + - ~/.pyenv |
| 64 | + - ~/virtualenvs |
| 65 | + - ~/.m2 |
| 66 | + - ~/.ivy2 |
| 67 | + - ~/.sbt |
| 68 | + - ~/.bundle |
| 69 | + - ~/.go_workspace |
| 70 | + - ~/.gradle |
| 71 | + - ~/.cache/bower |
| 72 | + - ".git" |
| 73 | + - ~/.stack |
| 74 | + - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work |
| 75 | + - ~/R |
| 76 | + # save "default" cache using the key "source-v2-" |
| 77 | + - save_cache: |
| 78 | + key: source-v2- |
| 79 | + paths: |
| 80 | + # This is a broad list of cache paths to include many possible development environments |
| 81 | + # You can probably delete some of these entries |
| 82 | + - vendor/bundle |
| 83 | + - ~/.nvm |
| 84 | + - ~/.pyenv |
| 85 | + - ~/virtualenvs |
| 86 | + - ~/.m2 |
| 87 | + - ~/.ivy2 |
| 88 | + - ~/.sbt |
| 89 | + - ~/.bundle |
| 90 | + - ~/.go_workspace |
| 91 | + - ~/.gradle |
| 92 | + - ~/.cache/bower |
| 93 | + - ".git" |
| 94 | + - ~/.stack |
| 95 | + - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work |
| 96 | + - ~/R |
| 97 | + # Teardown |
| 98 | + # 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 |
| 99 | + # Save test results |
| 100 | + - store_test_results: |
| 101 | + path: /tmp/circleci-test-results |
| 102 | + # Save artifacts |
| 103 | + - store_artifacts: |
| 104 | + path: /tmp/circleci-artifacts |
| 105 | + - store_artifacts: |
| 106 | + path: /tmp/circleci-test-results |
| 107 | + command_docker_build_and_test: |
| 108 | + parameters: |
| 109 | + nodeNo: |
| 110 | + default: "0" |
| 111 | + type: string |
| 112 | + steps: |
| 113 | + # Machine Setup |
| 114 | + # 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 |
| 115 | + # 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. |
| 116 | + - checkout |
| 117 | + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. |
| 118 | + # In many cases you can simplify this from what is generated here. |
| 119 | + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' |
| 120 | + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS |
| 121 | + # This is based on your 1.0 configuration file or project settings |
| 122 | + # - run: |
| 123 | + # 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 |
| 124 | + # - run: |
| 125 | + # Test |
| 126 | + # - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error |
| 127 | + - run: |
| 128 | + name: "Setup custom environment variables" |
| 129 | + command: echo 'export CIRCLE_NODE_INDEX="<<parameters.nodeNo>>"' >> $BASH_ENV |
| 130 | + - run: ./CI/circle_parallel.sh |
| 131 | + # Teardown |
| 132 | + # 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 |
| 133 | + # Save test results |
| 134 | + - store_test_results: |
| 135 | + path: /tmp/circleci-test-results |
| 136 | + # Save artifacts |
| 137 | + - store_artifacts: |
| 138 | + path: /tmp/circleci-artifacts |
| 139 | + - store_artifacts: |
| 140 | + path: /tmp/circleci-test-results |
2 | 141 | jobs:
|
3 |
| - build: |
4 |
| - # docker: |
5 |
| - # #- image: openapitools/openapi-generator |
6 |
| - # - image: swaggerapi/petstore |
7 |
| - # environment: |
8 |
| - # SWAGGER_HOST=http://petstore.swagger.io |
9 |
| - # SWAGGER_BASE_PATH=/v2 |
| 142 | + node0: |
| 143 | + machine: |
| 144 | + image: ubuntu-2004:202201-02 |
| 145 | + working_directory: ~/OpenAPITools/openapi-generator |
| 146 | + shell: /bin/bash --login |
| 147 | + environment: |
| 148 | + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts |
| 149 | + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results |
| 150 | + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator |
| 151 | + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli |
| 152 | + steps: |
| 153 | + - command_build_and_test: |
| 154 | + nodeNo: "0" |
| 155 | + node1: |
10 | 156 | machine:
|
11 |
| - image: circleci/classic:latest |
| 157 | + image: ubuntu-2004:202201-02 |
12 | 158 | working_directory: ~/OpenAPITools/openapi-generator
|
13 |
| - parallelism: 4 |
14 | 159 | shell: /bin/bash --login
|
15 | 160 | environment:
|
16 | 161 | CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
17 | 162 | CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
18 | 163 | DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
19 | 164 | DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
20 | 165 | steps:
|
21 |
| - # Restore the dependency cache |
22 |
| - - restore_cache: |
23 |
| - keys: |
24 |
| - # Default branch if not |
25 |
| - - source-v2-{{ .Branch }}-{{ .Revision }} |
26 |
| - - source-v2-{{ .Branch }}- |
27 |
| - - source-v2- |
28 |
| - # Machine Setup |
29 |
| - # 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 |
30 |
| - # 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. |
31 |
| - - checkout |
32 |
| - # Prepare for artifact and test results collection equivalent to how it was done on 1.0. |
33 |
| - # In many cases you can simplify this from what is generated here. |
34 |
| - # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' |
35 |
| - - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS |
36 |
| - # This is based on your 1.0 configuration file or project settings |
37 |
| - - run: |
38 |
| - 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 |
39 |
| - - run: |
40 |
| - command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' |
41 |
| - - run: |
42 |
| - command: |- |
43 |
| - printf '127.0.0.1 petstore.swagger.io |
44 |
| - ' | sudo tee -a /etc/hosts |
45 |
| - # Dependencies |
46 |
| - # Install latest stable node for angular 6 |
47 |
| - - run: |
48 |
| - name: Install node@stable (for angular 6) |
49 |
| - command: | |
50 |
| - set +e |
51 |
| - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash |
52 |
| - export NVM_DIR="/opt/circleci/.nvm" |
53 |
| - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" |
54 |
| - nvm install stable |
55 |
| - nvm alias default stable |
56 |
| -
|
57 |
| - # Each step uses the same `$BASH_ENV`, so need to modify it |
58 |
| - echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV |
59 |
| - echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV |
60 |
| - - run: node --version |
61 |
| -# - run: docker pull openapitools/openapi-petstore |
62 |
| -# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore |
63 |
| - - run: docker pull swaggerapi/petstore |
64 |
| - - run: docker run --name petstore.swagger -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore |
65 |
| - - run: docker ps -a |
66 |
| - - run: sleep 30 |
67 |
| - - run: cat /etc/hosts |
68 |
| - # Test |
69 |
| - - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error |
70 |
| - - run: ./CI/circle_parallel.sh |
71 |
| - # Save dependency cache |
72 |
| - - save_cache: |
73 |
| - key: source-v2-{{ .Branch }}-{{ .Revision }} |
74 |
| - paths: |
75 |
| - # This is a broad list of cache paths to include many possible development environments |
76 |
| - # You can probably delete some of these entries |
77 |
| - - vendor/bundle |
78 |
| - - ~/virtualenvs |
79 |
| - - ~/.m2 |
80 |
| - - ~/.ivy2 |
81 |
| - - ~/.sbt |
82 |
| - - ~/.bundle |
83 |
| - - ~/.go_workspace |
84 |
| - - ~/.gradle |
85 |
| - - ~/.cache/bower |
86 |
| - - ".git" |
87 |
| - - ~/.stack |
88 |
| - - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work |
89 |
| - - ~/R |
90 |
| - # save "default" cache using the key "source-v2-" |
91 |
| - - save_cache: |
92 |
| - key: source-v2- |
93 |
| - paths: |
94 |
| - # This is a broad list of cache paths to include many possible development environments |
95 |
| - # You can probably delete some of these entries |
96 |
| - - vendor/bundle |
97 |
| - - ~/virtualenvs |
98 |
| - - ~/.m2 |
99 |
| - - ~/.ivy2 |
100 |
| - - ~/.sbt |
101 |
| - - ~/.bundle |
102 |
| - - ~/.go_workspace |
103 |
| - - ~/.gradle |
104 |
| - - ~/.cache/bower |
105 |
| - - ".git" |
106 |
| - - ~/.stack |
107 |
| - - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work |
108 |
| - - ~/R |
109 |
| - # Teardown |
110 |
| - # 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 |
111 |
| - # Save test results |
112 |
| - - store_test_results: |
113 |
| - path: /tmp/circleci-test-results |
114 |
| - # Save artifacts |
115 |
| - - store_artifacts: |
116 |
| - path: /tmp/circleci-artifacts |
117 |
| - - store_artifacts: |
118 |
| - path: /tmp/circleci-test-results |
| 166 | + - command_build_and_test: |
| 167 | + nodeNo: "1" |
| 168 | + node2: |
| 169 | + machine: |
| 170 | + image: ubuntu-2004:202201-02 |
| 171 | + working_directory: ~/OpenAPITools/openapi-generator |
| 172 | + shell: /bin/bash --login |
| 173 | + environment: |
| 174 | + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts |
| 175 | + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results |
| 176 | + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator |
| 177 | + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli |
| 178 | + steps: |
| 179 | + - command_build_and_test: |
| 180 | + nodeNo: "2" |
| 181 | + node3: |
| 182 | + machine: |
| 183 | + image: ubuntu-2004:202201-02 |
| 184 | + working_directory: ~/OpenAPITools/openapi-generator |
| 185 | + shell: /bin/bash --login |
| 186 | + environment: |
| 187 | + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts |
| 188 | + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results |
| 189 | + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator |
| 190 | + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli |
| 191 | + steps: |
| 192 | + - checkout |
| 193 | + - command_build_and_test: |
| 194 | + nodeNo: "3" |
| 195 | + node4: |
| 196 | + docker: |
| 197 | + - image: fkrull/multi-python |
| 198 | + working_directory: ~/OpenAPITools/openapi-generator |
| 199 | + shell: /bin/bash --login |
| 200 | + environment: |
| 201 | + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts |
| 202 | + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results |
| 203 | + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator |
| 204 | + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli |
| 205 | + steps: |
| 206 | + - checkout |
| 207 | + - command_docker_build_and_test: |
| 208 | + nodeNo: "4" |
| 209 | +workflows: |
| 210 | + version: 2 |
| 211 | + build: |
| 212 | + jobs: |
| 213 | + - node0 |
| 214 | + - node1 |
| 215 | + - node2 |
| 216 | + - node3 |
| 217 | + - node4 |
0 commit comments