Skip to content

Commit

Permalink
Make sure that docker entrypoint works for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed Aug 22, 2023
1 parent f91d0fd commit 6c230db
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ jobs:
working-directory: ./cbioportal-docker-compose
run: |
cd ./data && ./init.sh && rm -rf ./studies/* && cd ../config && \
cat $PORTAL_SOURCE_DIR/portal/target/portal/WEB-INF/classes/portal.properties | \
sed 's|db.connection_string=.*|db.connection_string=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false|g' \
cat $PORTAL_SOURCE_DIR/portal/target/classes/portal.properties | \
# TODO: remove 4 lines below after upgrade of cbioportal-docker-compose to > v5.3.20
sed 's|db.host=.*||' | \
sed 's|db.portal_db_name=.*||' | \
sed 's|db.use_ssl=.*||' | \
sed 's|db.connection_string=.*|db.connection_string=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false&allowPublicKeyRetrieval=true|' \
> portal.properties
- name: 'Start cbioportal-docker-compose'
working-directory: ./cbioportal-docker-compose
Expand Down
6 changes: 5 additions & 1 deletion docker/web-and-data/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ migrate_db() {
_main() {
# when running the webapp, check db and do migration first
# check if command is something like "java -jar webapp-runner.jar"
if [ -n "$SHOW_DEBUG_INFO" ] && [ "$SHOW_DEBUG_INFO" != "false" ]; then
echo Running: "$@"
fi

if [[ "$@" == *java* ]] && [[ "$@" == *-jar* ]] && [[ "$@" == *webapp-runner.jar* ]]; then
# Parse database config. Use command line parameters (e.g. -Ddb.host) if
# available, otherwise use portal.properties
if [ -n "$SHOW_DEBUG_INFO" ] && [ "$SHOW_DEBUG_INFO" != "false" ]; then
echo "Using database config:"
#parse_db_params_from_config_and_command_line $@
parse_db_params_from_config_and_command_line $@
fi

check_db_connection $@
Expand Down
3 changes: 3 additions & 0 deletions test/integration/docker-compose-localbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ version: '3'
services:
cbioportal:
command: /bin/sh -c "java -Xms2g -Xmx4g -Dauthenticate=noauthsessionservice -Dsession.service.url=http://cbioportal_session:5000/api/sessions/my_portal/ -jar webapp-runner.jar -AmaxHttpHeaderSize=16384 -AconnectionTimeout=20000 --enable-compression /app.war"
# command: tail -f /dev/null
volumes:
- $PORTAL_INFO_DIR:/portalinfo/
# make docker compose run the cbioportal version-under-test
# by volume mounting the local portal source folder into the container
# and running
- $PORTAL_SOURCE_DIR:/cbioportal/
- $PORTAL_SOURCE_DIR/portal/target/cbioportal.war:/app.war
# TODO: remove line below after upgrade of cbioportal-docker-compose to > v5.3.20
- $PORTAL_SOURCE_DIR/docker/web-and-data/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh

0 comments on commit 6c230db

Please sign in to comment.