From 9177155c7906498754057aa76c144c6bfb8ac4ba Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Mon, 8 Jul 2019 18:56:51 +0300 Subject: [PATCH] feat(nightlies): Add ability to build from nightlies (#211) This patch adds the optional IMAGE env variable to set the base image and adds nightly builds to Travis CI. --- .env.example | 3 ++- .travis.yml | 4 ++++ Dockerfile | 3 ++- docker-compose.yml | 5 ++++- test.sh | 8 ++++---- 5 files changed, 16 insertions(+), 7 deletions(-) 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