Skip to content
Snippets Groups Projects

Resolve "Gitlab-ci service interconnection"

Merged Mark requested to merge 16-gitlab-ci-service-interconnection into master
All threads resolved!
+ 21
19
@@ -74,23 +74,23 @@ behave-integration:
- name: ${CI_REGISTRY_IMAGE}/login_logout:${CI_COMMIT_REF_NAME}
alias: oauth
variables:
# Gitlab CI does not propagate service names to service containers
# it assigns addresses incrementally starting from 172.17.0.2
# in the order that the services are started which is the order of
# the services listed in the job configuration
DATABASE_HOST: "172.17.0.2" # 172.17.0.2 -> postgres
URLS_LOGIN: "http://172.17.0.3:5000/login" # 172.17.0.3 -> login
URLS_LOGOUT: "http://172.17.0.3:5000/logout"
LOGOUT_URL: "http://172.17.0.3:5000/logout"
URLS_POST_LOGOUT_REDIRECT: "http://172.17.0.3:5000/"
URLS_CONSENT: "http://172.17.0.4:5001/consent" # 172.17.0.4 -> consent
URLS_SELF_ISSUER: "http://172.17.0.5:4444/" # 172.17.0.5 -> hydra
BASE_URL: "http://172.17.0.5:4444/"
HYDRA_ADMIN_URL: "http://172.17.0.5:4445"
ACCESS_TOKEN_URL: "http://172.17.0.5:4444/oauth2/token"
AUTHORIZE_URL: "http://172.17.0.5:4444/oauth2/auth"
USERINFO_URL: "http://172.17.0.5:4444/userinfo"
GRAPHQL_URL: "http://172.17.0.6:5000/graphql" # 172.17.0.6 -> backend
# Feature Flag FF_NETWORK_PER_BUILD Enables creation of a docker network per build
# with the docker executor of the gitlab-runner. This is required for service
# interconnection. Requires gitlab-runner v12.9.0
FF_NETWORK_PER_BUILD: 1
DATABASE_HOST: "postgres"
URLS_LOGIN: "http://login:5000/login"
URLS_LOGOUT: "http://login:5000/logout"
LOGOUT_URL: "http://login/logout"
URLS_POST_LOGOUT_REDIRECT: "http://login:5000/"
URLS_CONSENT: "http://consent:5001/consent"
URLS_SELF_ISSUER: "http://hydra:4444/"
BASE_URL: "http://hydra:4444/"
HYDRA_ADMIN_URL: "http://hydra:4445"
ACCESS_TOKEN_URL: "http://hydra:4444/oauth2/token"
AUTHORIZE_URL: "http://hydra:4444/oauth2/auth"
USERINFO_URL: "http://hydra:4444/userinfo"
GRAPHQL_URL: "http://backend:5000/graphql"
GIT_SUBMODULE_STRATEGY: "recursive"
TESTUSER_USERNAME: "testuser"
TESTUSER_USERNAME2: "testuser2"
@@ -115,13 +115,15 @@ behave-integration:
FLASK_ENV: "development"
image: ${CI_REGISTRY_IMAGE}/integration_test:${CI_COMMIT_REF_NAME}
script:
- echo "WAIT FOR SERVICES TO INITIALIZE" && sleep 20
# Create user and application objects
- /bin/bash user-panel/backend/utils/create-user.bash ${TESTUSER_USERNAME} ${TESTUSER_PASSWORD} ${TESTUSER_EMAIL} backend:5000
- /bin/bash user-panel/backend/utils/create-user.bash ${TESTUSER_USERNAME2} ${TESTUSER_PASSWORD} ${TESTUSER_EMAIL2} backend:5000
- /bin/bash user-panel/backend/utils/create-application.bash ${KEY} backend:5000
- /bin/bash user-panel/backend/utils/create-application.bash ${KEY} "Application used for testing" backend:5000
- /bin/bash user-panel/backend/utils/create-role.bash ${ROLE} backend:5000
- /bin/bash user-panel/backend/utils/grant-access.bash ${TESTUSER_USERNAME} ${KEY} backend:5000
- /bin/bash user-panel/backend/utils/assign-role.bash ${TESTUSER_USERNAME} ${ROLE} backend:5000
# Wait for 60s for hydra to become available. Then create the oauth2 client object
- while [[ $HYDRASTATUS -ne "200" && 60 -ge $TIMER ]]; do HYDRASTATUS=`curl http://hydra:4445/health/ready -o /dev/null -w "%{http_code}"` || TIMER=$TIMER+5 && sleep 5 ; done
- /bin/bash test/create-hydra-client.bash ${KEY} ${SECRET} http://hydra:4445 http://oauth:5000/callback
- cd test/login_logout/test/behave/
- >
Loading