From 4994384657d899f68154d1ab594ab2bc1e0230bd Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 11:46:18 +0300 Subject: [PATCH 1/4] fix(install): Read and set .env in install.sh Fixes #597. --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index d391b2691f5..bb41a1ee102 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -e +if [ -f ".env" ]; then + source .env +fi + dc="docker-compose --no-ansi" dcr="$dc run --rm" From b1795277ce0c536a087e7fee2de4cbe021a0535f Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 13:07:45 +0300 Subject: [PATCH 2/4] don't override already set vars & export --- docker-compose.yml | 4 ++-- install.sh | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5048ebc1129..52fc6fe88c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ x-snuba-defaults: &snuba_defaults - redis - clickhouse - kafka - image: 'getsentry/snuba:$SENTRY_VERSION' + image: '${SNUBA_IMAGE:-getsentry/snuba:$SENTRY_VERSION}' environment: SNUBA_SETTINGS: docker CLICKHOUSE_HOST: clickhouse @@ -194,7 +194,7 @@ services: - relay relay: << : *restart_policy - image: 'getsentry/relay:$SENTRY_VERSION' + image: '${RELAY_IMAGE:-getsentry/relay:$SENTRY_VERSION}' volumes: - type: bind read_only: true diff --git a/install.sh b/install.sh index bb41a1ee102..ede5d0bf64b 100755 --- a/install.sh +++ b/install.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash set -e -if [ -f ".env" ]; then - source .env -fi +source <(grep -v '^#' .env | sed -E 's|^(.+)=(.*)$|: ${\1=\2}; export \1|g') dc="docker-compose --no-ansi" dcr="$dc run --rm" From cb7a56aa2a8f883f4add81fb8e1f2c9880df3e01 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 13:46:22 +0300 Subject: [PATCH 3/4] revert unintended change --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 52fc6fe88c2..5048ebc1129 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ x-snuba-defaults: &snuba_defaults - redis - clickhouse - kafka - image: '${SNUBA_IMAGE:-getsentry/snuba:$SENTRY_VERSION}' + image: 'getsentry/snuba:$SENTRY_VERSION' environment: SNUBA_SETTINGS: docker CLICKHOUSE_HOST: clickhouse @@ -194,7 +194,7 @@ services: - relay relay: << : *restart_policy - image: '${RELAY_IMAGE:-getsentry/relay:$SENTRY_VERSION}' + image: 'getsentry/relay:$SENTRY_VERSION' volumes: - type: bind read_only: true From e07a7ee5c8f115746e5c76ad93bde01c95b446f9 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 15:20:53 +0300 Subject: [PATCH 4/4] remove redundant logic after #602 --- install.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index ede5d0bf64b..9ccef093154 100755 --- a/install.sh +++ b/install.sh @@ -173,12 +173,8 @@ echo "" # redirection below and pass it through grep, ignoring all lines having this '-onpremise-local' suffix. $dc pull -q --ignore-pull-failures 2>&1 | grep -v -- -onpremise-local || true -if [ -z "$SENTRY_IMAGE" ]; then - docker pull getsentry/sentry:${SENTRY_VERSION:-latest} -else - # We may not have the set image on the repo (local images) so allow fails - docker pull $SENTRY_IMAGE || true; -fi +# We may not have the set image on the repo (local images) so allow fails +docker pull $SENTRY_IMAGE || true; echo "" echo "Building and tagging Docker images..."