Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix docker sentry connection #2342

Merged
merged 1 commit into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM alpine:latest
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG COMMIT
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="MonicaHQ, the Personal Relationship Manager" \
Expand Down Expand Up @@ -84,6 +85,7 @@ COPY routes ./routes
COPY scripts ./scripts

RUN echo $VCS_REF > .sentry-release
RUN echo $COMMIT > .sentry-commit
RUN mkdir -p bootstrap/cache
RUN mkdir -p storage
COPY .env.example .env
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ $(info BRANCH=$(BRANCH))
$(info BUILD_NUMBER=$(BUILD_NUMBER))

ifeq ($(GIT_COMMIT),)
GIT_COMMIT := $(shell git log --format="%h" -n 1)
GIT_COMMIT := $(shell git log --format="%H" -n 1)
GIT_REF := $(shell git log --format="%h" -n 1)
else
GIT_COMMIT := $(shell git rev-parse --short=8 ${GIT_COMMIT})
GIT_COMMIT := $(shell git rev-parse ${GIT_COMMIT})
GIT_REF := $(shell git rev-parse --short ${GIT_COMMIT})
endif
$(info GIT_COMMIT=$(GIT_COMMIT))
ifeq ($(GIT_TAG),)
Expand All @@ -48,7 +50,7 @@ BUILD := $(GIT_TAG)
ifeq ($(BUILD),)
ifeq ($(BRANCH),)
# If we are not on CI or it's not a TAG build, we add "-dev" to the name
BUILD := $(GIT_COMMIT)$(shell if ! $$(git describe --abbrev=0 --tags --exact-match ${GIT_COMMIT} 2>/dev/null >/dev/null); then echo "-dev"; fi)
BUILD := $(GIT_REF)$(shell if ! $$(git describe --abbrev=0 --tags --exact-match ${GIT_COMMIT} 2>/dev/null >/dev/null); then echo "-dev"; fi)
else
BUILD := $(BRANCH)
endif
Expand All @@ -73,7 +75,8 @@ docker:
docker_build:
docker build \
--build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
--build-arg VCS_REF=$(GIT_COMMIT) \
--build-arg VCS_REF=$(GIT_REF) \
--build-arg COMMIT=$(GIT_COMMIT) \
--build-arg VERSION=$(BUILD) \
-t $(DOCKER_IMAGE) .
docker images
Expand Down
5 changes: 3 additions & 2 deletions scripts/docker/test-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ fi
# Run migrations
${ARTISAN} monica:update --force -v

if [[ -n ${SENTRY_SUPPORT:-} && $SENTRY_SUPPORT ]]; then
if [[ -n ${SENTRY_SUPPORT:-} && $SENTRY_SUPPORT && -z ${SENTRY_NORELEASE:-} ]]; then
commit=$(cat .sentry-commit)
release=$(cat .sentry-release)
${ARTISAN} sentry:release --release=$release --commit=$release --environment=$SENTRY_ENV -v || true
${ARTISAN} sentry:release --release=$release --commit=$commit --environment=$SENTRY_ENV -v || true
fi

# Run cron
Expand Down