Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Merged
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
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
sha := $(shell git rev-parse --short=7 HEAD)
long_sha := $(shell git rev-parse HEAD)
merge_sha := $(shell git merge-base HEAD^ origin/main)
sha ?= $(shell git rev-parse --short=7 HEAD)
long_sha ?= $(shell git rev-parse HEAD)
merge_sha ?= $(shell git merge-base HEAD^ origin/main)
release_version := `cat VERSION`
build_date ?= $(shell git show -s --date=iso8601-strict --pretty=format:%cd $$sha)
branch = $(shell git branch | grep \* | cut -f2 -d' ')
epoch := $(shell date +"%s")
branch ?= $(shell git branch | grep \* | cut -f2 -d' ')
epoch ?= $(shell date +"%s")
AR_REPO ?= codecov/api
DOCKERHUB_REPO ?= codecov/self-hosted-api
REQUIREMENTS_TAG := requirements-v1-$(shell sha1sum uv.lock | cut -d ' ' -f 1)-$(shell sha1sum docker/Dockerfile.requirements | cut -d ' ' -f 1)
VERSION := release-${sha}
REQUIREMENTS_TAG ?= requirements-v1-$(shell sha1sum uv.lock | cut -d ' ' -f 1)-$(shell sha1sum docker/Dockerfile.requirements | cut -d ' ' -f 1)
VERSION ?= release-${sha}
CODECOV_UPLOAD_TOKEN ?= "notset"
CODECOV_STATIC_TOKEN ?= "notset"
CODECOV_URL ?= "https://api.codecov.io"
Expand All @@ -19,6 +19,9 @@ export CODECOV_TOKEN=${CODECOV_UPLOAD_TOKEN}
API_DOMAIN ?= api
PROXY_NETWORK ?= api_default

DEFAULT_REQS_TAG := requirements-v1-$(shell sha1sum uv.lock | cut -d ' ' -f 1)-$(shell sha1sum docker/Dockerfile.requirements | cut -d ' ' -f 1)
REQUIREMENTS_TAG ?= ${DEFAULT_REQS_TAG}

# We allow this to be overridden so that we can run `pytest` from this directory
# but have the junit file use paths relative to a parent directory. This will
# help us move to a monorepo.
Expand Down Expand Up @@ -70,6 +73,12 @@ lint.check:
ruff format --check

build.requirements:
# If make was given a different requirements tag, we assume a suitable image
# was already built (e.g. by umbrella) and don't want to build this one.
ifneq (${REQUIREMENTS_TAG},${DEFAULT_REQS_TAG})
echo "Error: building api reqs image despite another being provided"
exit 1
endif
# if docker pull succeeds, we have already build this version of
# requirements.txt. Otherwise, build and push a version tagged
# with the hash of this requirements.txt
Expand Down
Loading