@@ -102,7 +102,8 @@ jobs:
102102 push : true
103103 tags : ${{ steps.meta.outputs.tags }}
104104 labels : ${{ steps.meta.outputs.labels }}
105- - name : Docker test
105+
106+ - name : Docker test with a dedicated OpenDJ container
106107 shell : bash
107108 run : |
108109 docker network create test-openam
@@ -153,3 +154,153 @@ jobs:
153154 http://openam.example.org:8080/openam/json/authenticate | grep tokenId'
154155
155156 docker inspect --format="{{json .State.Health.Status}}" test-openam | grep -q \"healthy\"
157+
158+ echo "Stopping containers and removing the network"
159+ docker stop test-opendj test-openam
160+ docker network rm test-openam
161+
162+ - name : Docker multi-server test
163+ shell : bash
164+ run : |
165+
166+ docker network create test-openam
167+
168+ echo "Starting OpenAM-1 container"
169+ docker run --rm -it -d -h openam1.example.org --name=test-openam1 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}
170+
171+ echo "Waiting for OpenAM-1 to be alive..."
172+ timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam1 | grep -q \"healthy\"; do sleep 10; done'
173+
174+ docker exec -w '/usr/openam/ssoconfiguratortools' test-openam1 bash -c \
175+ 'echo "ACCEPT_LICENSES=true
176+ SERVER_URL=http://openam1.example.org:8080
177+ DEPLOYMENT_URI=/$OPENAM_PATH
178+ BASE_DIR=$OPENAM_DATA_DIR
179+ locale=en_US
180+ PLATFORM_LOCALE=en_US
181+ AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
182+ ADMIN_PWD=ampassword
183+ AMLDAPUSERPASSWD=password
184+ COOKIE_DOMAIN=example.org
185+ ACCEPT_LICENSES=true
186+ DATA_STORE=embedded
187+ DIRECTORY_SSL=SIMPLE
188+ DIRECTORY_SERVER=openam1.example.org
189+ DIRECTORY_PORT=50389
190+ DIRECTORY_ADMIN_PORT=4444
191+ DIRECTORY_JMX_PORT=1689
192+ ROOT_SUFFIX=dc=openam,dc=example,dc=org
193+ DS_DIRMGRDN=cn=Directory Manager
194+ DS_DIRMGRPASSWD=password
195+ LB_SITE_NAME=lb
196+ LB_PRIMARY_URL=http://lb.example.org:80/openam
197+ " > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
198+
199+ docker exec test-openam1 bash -c \
200+ 'curl \
201+ --request POST \
202+ --header "Content-Type: application/json" \
203+ --header "X-OpenAM-Username: amadmin" \
204+ --header "X-OpenAM-Password: ampassword" \
205+ --data "{}" \
206+ http://openam1.example.org:8080/openam/json/authenticate | grep tokenId'
207+
208+ docker inspect --format="{{json .State.Health.Status}}" test-openam1 | grep -q \"healthy\"
209+
210+ echo "Add another two OpenAM servers to the cluster"
211+
212+ echo "Starting OpenAM-2 container..."
213+ docker run --rm -it -d -h openam2.example.org --name=test-openam2 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}
214+
215+ echo "waiting for OpenAM-2 to be alive..."
216+ timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam2 | grep -q \"healthy\"; do sleep 10; done'
217+
218+ docker exec -w '/usr/openam/ssoconfiguratortools' test-openam2 bash -c \
219+ 'echo "ACCEPT_LICENSES=true
220+ SERVER_URL=http://openam2.example.org:8080
221+ DEPLOYMENT_URI=/$OPENAM_PATH
222+ BASE_DIR=$OPENAM_DATA_DIR
223+ locale=en_US
224+ PLATFORM_LOCALE=en_US
225+ AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
226+ ADMIN_PWD=ampassword
227+ AMLDAPUSERPASSWD=password
228+ COOKIE_DOMAIN=example.org
229+ ACCEPT_LICENSES=true
230+ DATA_STORE=embedded
231+ DIRECTORY_SSL=SIMPLE
232+ DIRECTORY_SERVER=openam2.example.org
233+ DIRECTORY_PORT=50389
234+ DIRECTORY_ADMIN_PORT=4444
235+ DIRECTORY_JMX_PORT=1689
236+ ROOT_SUFFIX=dc=openam,dc=example,dc=org
237+ DS_DIRMGRDN=cn=Directory Manager
238+ DS_DIRMGRPASSWD=password
239+ DS_EMB_REPL_FLAG=embReplFlag
240+ DS_EMB_REPL_REPLPORT1=8989
241+ DS_EMB_REPL_HOST2=openam1.example.com
242+ DS_EMB_REPL_ADMINPORT2=4444
243+ DS_EMB_REPL_REPLPORT2=8989
244+ existingserverid=http://openam1.example.org:8080
245+ LB_SITE_NAME=lb
246+ LB_PRIMARY_URL=http://lb.example.org:80/openam
247+ " > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
248+
249+ docker exec test-openam2 bash -c \
250+ ' curl \
251+ --request POST \
252+ --header "Content-Type: application/json" \
253+ --header "X-OpenAM-Username: amadmin" \
254+ --header "X-OpenAM-Password: ampassword" \
255+ --data "{}" \
256+ http://openam2.example.org:8080/openam/json/authenticate | grep tokenId'
257+
258+ docker inspect --format="{{json .State.Health.Status}}" test-openam2 | grep -q \"healthy\"
259+
260+ echo "Starting OpenAM-3 container..."
261+ docker run --rm -it -d -h openam3.example.org --name=test-openam3 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}
262+
263+ echo "waiting for OpenAM-3 to be alive..."
264+ timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam3 | grep -q \"healthy\"; do sleep 10; done'
265+
266+ docker exec -w '/usr/openam/ssoconfiguratortools' test-openam2 bash -c \
267+ ' echo "ACCEPT_LICENSES=true
268+ SERVER_URL=http://openam3.example.org:8080
269+ DEPLOYMENT_URI=/$OPENAM_PATH
270+ BASE_DIR=$OPENAM_DATA_DIR
271+ locale=en_US
272+ PLATFORM_LOCALE=en_US
273+ AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
274+ ADMIN_PWD=ampassword
275+ AMLDAPUSERPASSWD=password
276+ COOKIE_DOMAIN=example.org
277+ ACCEPT_LICENSES=true
278+ DATA_STORE=embedded
279+ DIRECTORY_SSL=SIMPLE
280+ DIRECTORY_SERVER=openam3.example.org
281+ DIRECTORY_PORT=50389
282+ DIRECTORY_ADMIN_PORT=4444
283+ DIRECTORY_JMX_PORT=1689
284+ ROOT_SUFFIX=dc=openam,dc=example,dc=org
285+ DS_DIRMGRDN=cn=Directory Manager
286+ DS_DIRMGRPASSWD=password
287+ DS_EMB_REPL_FLAG=embReplFlag
288+ DS_EMB_REPL_REPLPORT1=8989
289+ DS_EMB_REPL_HOST2=openam2.example.com
290+ DS_EMB_REPL_ADMINPORT2=4444
291+ DS_EMB_REPL_REPLPORT2=9989
292+ existingserverid=http://openam2.example.org:8080
293+ LB_SITE_NAME=lb
294+ LB_PRIMARY_URL=http://lb.example.org:80/openam
295+ " > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
296+
297+ docker exec test-openam3 bash -c \
298+ ' curl \
299+ --request POST \
300+ --header "Content-Type: application/json" \
301+ --header "X-OpenAM-Username: amadmin" \
302+ --header "X-OpenAM-Password: ampassword" \
303+ --data "{}" \
304+ http://openam3.example.org:8080/openam/json/authenticate | grep tokenId'
305+
306+ docker inspect --format="{{json .State.Health.Status}}" test-openam3 | grep -q \"healthy\"
0 commit comments