diff --git a/.env.example b/.env.example index c560055..471e7d4 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ +IMAGE=sentry:9.1 # Run `docker-compose run web config generate-secret-key` # to get the SENTRY_SECRET_KEY value. -SENTRY_SECRET_KEY= +SENTRY_SECRET_KEY= \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 8ad3f03..8d53fb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: bash services: docker +env: + - IMAGE=sentry:9.1 + - IMAGE=getsentry/sentry:git + script: - ./install.sh - docker-compose run --rm web createuser --superuser --email test@sentry.io --password test123TEST diff --git a/Dockerfile b/Dockerfile index e5df0de..e42391e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,2 @@ -FROM sentry:9.1-onbuild +ARG IMAGE +FROM ${IMAGE}-onbuild diff --git a/docker-compose.yml b/docker-compose.yml index 68348e2..bcc9cb4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,10 @@ version: '3.4' x-defaults: &defaults restart: unless-stopped - build: . + build: + context: . + args: + IMAGE: ${IMAGE} depends_on: - redis - postgres diff --git a/test.sh b/test.sh index 0465ae1..688787a 100755 --- a/test.sh +++ b/test.sh @@ -5,9 +5,9 @@ TEST_USER='test@sentry.io' TEST_PASS='test123TEST' COOKIE_FILE=$(mktemp) declare -a TEST_STRINGS=( - '"isAuthenticated":true,' - '"username":"test@sentry.io",' - '"isSuperuser":true,' + '"isAuthenticated":true' + '"username":"test@sentry.io"' + '"isSuperuser":true' ) INITIAL_AUTH_REDIRECT=$(curl -sL -o /dev/null http://localhost:9000 -w %{url_effective}) @@ -28,6 +28,6 @@ TEST_RESULT=0 for i in "${TEST_STRINGS[@]}" do echo "Testing '$i'..." - echo "$LOGIN_RESPONSE" | grep "$i" >& /dev/null + echo "$LOGIN_RESPONSE" | grep "$i[,}]" >& /dev/null echo "Pass." done