@@ -2,8 +2,8 @@ version: 2.1
2
2
commands : # a reusable command with parameters
3
3
command_build_and_test :
4
4
parameters :
5
- nodeNo :
6
- default : " 0 "
5
+ jobId :
6
+ default : " unset "
7
7
type : string
8
8
steps :
9
9
# Restore the dependency cache
@@ -13,17 +13,6 @@ commands: # a reusable command with parameters
13
13
- source-v2-{{ .Branch }}-{{ .Revision }}
14
14
- source-v2-{{ .Branch }}-
15
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
16
# 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
17
- checkout
29
18
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
@@ -33,24 +22,10 @@ commands: # a reusable command with parameters
33
22
# This is based on your 1.0 configuration file or project settings
34
23
- run :
35
24
command : java -version
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 openapijsonschematools/openapi-petstore
43
- # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapijsonschematools/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
25
# Test
50
- - run : mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
51
26
- run :
52
27
name : " Setup custom environment variables"
53
- command : echo 'export CIRCLE_NODE_INDEX ="<<parameters.nodeNo >>"' >> $BASH_ENV
28
+ command : echo 'export CIRCLE_JOB_ID ="<<parameters.jobId >>"' >> $BASH_ENV
54
29
- run : ./.circleci/parallel.sh
55
30
# Save dependency cache
56
31
- save_cache :
@@ -59,40 +34,33 @@ commands: # a reusable command with parameters
59
34
# This is a broad list of cache paths to include many possible development environments
60
35
# You can probably delete some of these entries
61
36
- vendor/bundle
62
- - ~/.nvm
63
37
- ~/.pyenv
64
38
- ~/virtualenvs
65
39
- ~/.m2
66
40
- ~/.ivy2
67
41
- ~/.sbt
68
42
- ~/.bundle
69
- - ~/.go_workspace
70
43
- ~/.gradle
71
44
- ~/.cache/bower
72
45
- " .git"
73
46
- ~/.stack
74
- - ~/R
75
47
# save "default" cache using the key "source-v2-"
76
48
- save_cache :
77
49
key : source-v2-
78
50
paths :
79
51
# This is a broad list of cache paths to include many possible development environments
80
52
# You can probably delete some of these entries
81
53
- vendor/bundle
82
- - ~/.nvm
83
54
- ~/.pyenv
84
55
- ~/virtualenvs
85
56
- ~/.m2
86
57
- ~/.ivy2
87
58
- ~/.sbt
88
59
- ~/.bundle
89
- - ~/.go_workspace
90
60
- ~/.gradle
91
61
- ~/.cache/bower
92
62
- " .git"
93
63
- ~/.stack
94
- - /home/circleci/OpenAPITools/openapi-json-schema-generator/samples/client/petstore/haskell-http-client/.stack-work
95
- - ~/R
96
64
# Teardown
97
65
# 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
98
66
# Save test results
@@ -105,8 +73,8 @@ commands: # a reusable command with parameters
105
73
path : /tmp/circleci-test-results
106
74
command_docker_build_and_test :
107
75
parameters :
108
- nodeNo :
109
- default : " 0 "
76
+ jobId :
77
+ default : " unset "
110
78
type : string
111
79
steps :
112
80
# Machine Setup
@@ -117,15 +85,9 @@ commands: # a reusable command with parameters
117
85
# In many cases you can simplify this from what is generated here.
118
86
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
119
87
- run : mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
120
- # This is based on your 1.0 configuration file or project settings
121
- # - run:
122
- # 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
123
- # - run:
124
- # Test
125
- # - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
126
88
- run :
127
89
name : " Setup custom environment variables"
128
- command : echo 'export CIRCLE_NODE_INDEX ="<<parameters.nodeNo >>"' >> $BASH_ENV
90
+ command : echo 'export CIRCLE_JOB_ID ="<<parameters.jobId >>"' >> $BASH_ENV
129
91
- run : ./.circleci/parallel.sh
130
92
# Teardown
131
93
# 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
@@ -138,18 +100,7 @@ commands: # a reusable command with parameters
138
100
- store_artifacts :
139
101
path : /tmp/circleci-test-results
140
102
jobs :
141
- node0 :
142
- machine :
143
- image : ubuntu-2004:202201-02
144
- working_directory : ~/OpenAPITools/openapi-json-schema-generator
145
- shell : /bin/bash --login
146
- environment :
147
- CIRCLE_ARTIFACTS : /tmp/circleci-artifacts
148
- CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
149
- steps :
150
- - command_build_and_test :
151
- nodeNo : " 0"
152
- node1 :
103
+ ensureSamplesAndGeneratorDocsUpToDate :
153
104
machine :
154
105
image : ubuntu-2004:202201-02
155
106
working_directory : ~/OpenAPITools/openapi-json-schema-generator
@@ -159,8 +110,8 @@ jobs:
159
110
CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
160
111
steps :
161
112
- command_build_and_test :
162
- nodeNo : " 1 "
163
- node2 :
113
+ jobId : " ensureSamplesAndGeneratorDocsUpToDate "
114
+ mvnCleanInstall :
164
115
machine :
165
116
image : ubuntu-2004:202201-02
166
117
working_directory : ~/OpenAPITools/openapi-json-schema-generator
@@ -170,20 +121,8 @@ jobs:
170
121
CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
171
122
steps :
172
123
- command_build_and_test :
173
- nodeNo : " 2"
174
- node3 :
175
- machine :
176
- image : ubuntu-2004:202201-02
177
- working_directory : ~/OpenAPITools/openapi-json-schema-generator
178
- shell : /bin/bash --login
179
- environment :
180
- CIRCLE_ARTIFACTS : /tmp/circleci-artifacts
181
- CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
182
- steps :
183
- - checkout
184
- - command_build_and_test :
185
- nodeNo : " 3"
186
- node4 :
124
+ jobId : " mvnCleanInstall"
125
+ testPythonClientSamples :
187
126
docker :
188
127
- image : python:3.8
189
128
working_directory : ~/OpenAPITools/openapi-json-schema-generator
@@ -194,13 +133,11 @@ jobs:
194
133
steps :
195
134
- checkout
196
135
- command_docker_build_and_test :
197
- nodeNo : " 4 "
136
+ jobId : " testPythonClientSamples "
198
137
workflows :
199
138
version : 2
200
139
build :
201
140
jobs :
202
- - node0
203
- - node1
204
- - node2
205
- - node3
206
- - node4
141
+ - ensureSamplesAndGeneratorDocsUpToDate
142
+ - mvnCleanInstall
143
+ - testPythonClientSamples
0 commit comments