This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
forked from codecov/codecov-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (64 loc) · 3.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
sha := $(shell git rev-parse --short=7 HEAD)
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")
build.local:
DOCKER_BUILDKIT=1 docker build -f Dockerfile . -t codecov/api:latest --ssh default
build.enterprise.local:
DOCKER_BUILDKIT=1 docker build -f Dockerfile.local-enterprise . -t codecov/enterprise-api:latest-stable --ssh default
build.base:
DOCKER_BUILDKIT=1 docker build -f Dockerfile.requirements . -t codecov/baseapi:latest --ssh default
build:
$(MAKE) build.base
$(MAKE) build.local
build.enterprise_runtime:
# $(MAKE) build.enterprise
docker build -f Dockerfile.enterprise_runtime . -t codecov/api-enterprise-runtime:${release_version} \
--build-arg CODECOV_ENTERPRISE_RELEASE=codecov/enterprise-api:${release_version} \
--build-arg RELEASE_VERSION=${release_version} \
--label "org.label-schema.build-date"="$(build_date)" \
--label "org.label-schema.name"="Self-Hosted API" \
--label "org.label-schema.vendor"="Codecov" \
--label "org.label-schema.version"="${release_version}"
docker tag codecov/api-enterprise-runtime:${release_version} codecov/api-enterprise-runtime:latest-stable
build.enterprise:
$(MAKE) build
docker build -f Dockerfile.enterprise . -t codecov/enterprise-api:${release_version} \
--label "org.label-schema.build-date"="$(build_date)" \
--label "org.label-schema.name"="Self-Hosted API (no dependencies)" \
--label "org.label-schema.vendor"="Codecov" \
--label "org.label-schema.version"="${release_version}"
docker tag codecov/enterprise-api:${release_version} codecov/enterprise-api:latest-stable
build.enterprise-private:
docker build -f Dockerfile.enterprise . -t codecov/enterprise-private-api:${release_version}-${sha} \
--label "org.label-schema.build-date"="$(build_date)" \
--label "org.label-schema.name"="Self-Hosted API Private" \
--label "org.label-schema.vendor"="Codecov" \
--label "org.label-schema.version"="${release_version}-${sha}" \
--label "org.vcs-branch"="$(branch)"
run.enterprise:
docker-compose -f docker-compose-enterprise.yml up -d
enterprise:
$(MAKE) build.enterprise
$(MAKE) run.enterprise
check-for-migration-conflicts:
python manage.py check_for_migration_conflicts
push.enterprise-private:
docker push codecov/enterprise-private-api:${release_version}-${sha}
test:
python -m pytest --cov=./
test.unit:
python -m pytest --cov=./ -m "not integration" --cov-report=xml:unit.coverage.xml
test.integration:
python -m pytest --cov=./ -m "integration" --cov-report=xml:integration.coverage.xml
lint:
pip3 install black==22.3.0 isort
black .
isort --profile black .
tag.qa-release:
git tag -a qa-${release_version}-${sha}-${epoch} -m "Autogenerated tag for enterprise api QA ${version}"
git push origin qa-${release_version}-${sha}-${epoch}
tag.enterprise-release:
git tag -a enterprise-${release_version} -m "Autogenerated tag for enterprise api release ${version}"
git push origin enterprise-${release_version}