Skip to content

Commit 5267cd7

Browse files
authored
Docker integration test with OpenDJ separate instance (#866)
1 parent 8b42fd3 commit 5267cd7

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,31 +101,54 @@ jobs:
101101
- name: Docker test
102102
shell: bash
103103
run: |
104-
docker run --rm -it -d --memory="2g" -h openam.example.org --name=test localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}
105-
timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test | grep -q \"healthy\"; do sleep 10; done'
106-
docker exec -w '/usr/openam/ssoconfiguratortools' test bash -c \
104+
docker network create test-openam
105+
docker run --rm -it -d --hostname opendj -p 1389:1389 -p 4444:4444 --name test-opendj --network test-openam openidentityplatform/opendj:latest
106+
docker run --rm -it -d --memory="2g" -h openam.example.org --name=test-openam --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}
107+
108+
echo "waiting for OpenDJ to be alive..."
109+
timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-opendj | grep -q \"healthy\"; do sleep 10; done'
110+
echo "waiting for OpenAM to be alive..."
111+
timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam | grep -q \"healthy\"; do sleep 10; done'
112+
113+
docker exec -w '/usr/openam/ssoconfiguratortools' test-openam bash -c \
107114
'echo "ACCEPT_LICENSES=true
108115
SERVER_URL=http://openam.example.org:8080
109116
DEPLOYMENT_URI=/$OPENAM_PATH
110117
BASE_DIR=$OPENAM_DATA_DIR
111118
locale=en_US
112119
PLATFORM_LOCALE=en_US
113120
AM_ENC_KEY=
114-
ADMIN_PWD=passw0rd
115-
AMLDAPUSERPASSWD=p@passw0rd
121+
ADMIN_PWD=ampassword
122+
AMLDAPUSERPASSWD=password
116123
COOKIE_DOMAIN=example.org
117-
ACCEPT_LICENSES=true
118-
DATA_STORE=embedded
124+
DATA_STORE=dirServer
119125
DIRECTORY_SSL=SIMPLE
120-
DIRECTORY_SERVER=openam.example.org
121-
DIRECTORY_PORT=50389
126+
DIRECTORY_SERVER=opendj
127+
DIRECTORY_PORT=1389
122128
DIRECTORY_ADMIN_PORT=4444
123129
DIRECTORY_JMX_PORT=1689
124-
ROOT_SUFFIX=dc=openam,dc=example,dc=org
130+
ROOT_SUFFIX=dc=example,dc=com
125131
DS_DIRMGRDN=cn=Directory Manager
126-
DS_DIRMGRPASSWD=passw0rd" > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
127-
sleep 35
128-
docker inspect --format="{{json .State.Health.Status}}" test | grep -q \"healthy\"
132+
DS_DIRMGRPASSWD=password
133+
USERSTORE_TYPE=LDAPv3ForOpenDS
134+
USERSTORE_SSL=SIMPLE
135+
USERSTORE_HOST=opendj
136+
USERSTORE_PORT=1389
137+
USERSTORE_SUFFIX=dc=example,dc=com
138+
USERSTORE_MGRDN=cn=Directory Manager
139+
USERSTORE_PASSWD=password
140+
" > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
141+
142+
docker exec test-openam bash -c \
143+
'curl \
144+
--request POST \
145+
--header "Content-Type: application/json" \
146+
--header "X-OpenAM-Username: amadmin" \
147+
--header "X-OpenAM-Password: ampassword" \
148+
--data "{}" \
149+
http://openam.example.org:8080/openam/json/authenticate | grep tokenId'
150+
151+
docker inspect --format="{{json .State.Health.Status}}" test-openam | grep -q \"healthy\"
129152
build-docker-alpine:
130153
runs-on: 'ubuntu-latest'
131154
services:

0 commit comments

Comments
 (0)