Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
trent-codecov committed Jun 29, 2023
0 parents commit 0f9c0c4
Show file tree
Hide file tree
Showing 9 changed files with 340 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Version to release (optional)
required: false
force:
description: Force a release even when there are release-blockers (optional)
required: false
schedule:
- cron: "0 18 15 * *"
jobs:
release:
if: github.repository_owner == 'codecov'
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
- name: Prepare release
id: prepare-release
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
calver: true
outputs:
release-version: ${{ env.RELEASE_VERSION }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
tmp
.env
99 changes: 99 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Business Source License 1.1

Parameters

Licensor: Functional Software, Inc.
Licensed Work: Codecov
The Licensed Work is (c) 2023 Functional Software, Inc.
Additional Use Grant: You may make use of the Licensed Work, provided that you do
not use the Licensed Work for a Competing Service.

A "Competing Service" is a commercial offering that allows
third parties (other than your employees and contractors)
to access the functionality of the Licensed Work so that
such third parties directly benefit from the essential
features of the Licensed Work.

Change Date:2023-06-29 2027-01-01

Change License: Apache License, Version 2.0

Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.

-----------------------------------------------------------------------------

Business Source License 1.1

Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License’s text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

Covenants of Licensor

In consideration of the right to use this License’s text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where "compatible" means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.

2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.
39 changes: 39 additions & 0 deletions config/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
setup:
# Replace with the http location of your Codecov
# https://docs.codecov.io/docs/configuration#section-codecov-url
codecov_url: http://localhost:8080
#codecov_api_url: <codecov-url> # this defaults to <codecov-url> and is designed to work out of the box like this
#api_allowed_hosts: [] # this defaults to <codecov-url> and is designed to work out of the box like this
# Replace with your Codecov Enterprise License key. This is required for the containers to function.
# https://docs.codecov.io/docs/configuration#section-enterprise-license
enterprise_license: null
# https://docs.codecov.com/docs/configuration#instance-wide-admins
admins:
- service: github
username: "<your-user>"
# Replace with a random string
# https://docs.codecov.io/docs/configuration#section-cookie-secret
http:
cookie_secret: "<your-cookie-secret>"
timeseries:
enabled: true
github:
client_id: "<client-id>"
client_secret: "<client-secret>"
global_upload_token: "<upload-token>"
services:
redis_url: "redis://redis:6379"
database_url: "postgres://postgres:testpassword@postgres:5432/postgres"
timeseries_database_url: "postgres://postgres:testpassword@timescale:5432/postgres"
minio:
host: minio
port: 9000
# If using external storage. Comment above and uncomment below
# host: s3.amazonaws.com or storage.googleapis.com if using GCS
# bucket: <bucket-name>
# region: <bucket-region>
# verify_ssl: true
# port: 443
# access_key_id: <aws-iam-access-key> # or <gcs-hmac-key> if using GCS
# secret_access_key: <aws-iam-secret> # or <gcs-hmac-secret> if using GCS
# iam_auth: <boolean, default false> # set to true in AWS to attempt to authenticate via Instance role
118 changes: 118 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
version: "3"

services:
gateway:
image: codecov/enterprise-gateway:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
volumes:
- ./config:/config
#- ${CODECOV_SSL_CERT-/cert/codecov.crt}:/etc/codecov/ssl/certs/cert.crt:ro # uncomment if using ssl
ports:
- "${CODECOV_PORT-8080}:8080"
#- "${CODECOV_SSL_PORT-8443}:8443" # uncomment if using ssl
environment:
- CODECOV_GATEWAY_MINIO_ENABLED=true
#- CODECOV_GATEWAY_SSL_ENABLED=true # uncomment if using ssl
networks:
- codecov
depends_on:
- api
- frontend

frontend:
image: codecov/enterprise-frontend:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
environment:
- CODECOV_BASE_HOST=localhost:8080
- CODECOV_API_HOST=localhost:8080
- CODECOV_IA_HOST=localhost:8080
- CODECOV_SCHEME=http
volumes:
- ./config:/config
ports:
- "8080"
networks:
- codecov

api:
image: codecov/enterprise-api:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
# build: # uncomment if on a mac
# dockerfile: ./m1-build-fix/Dockerfile
# context: .
volumes:
- ./config:/config
networks:
- codecov
depends_on:
- minio
- timescale
- postgres
- redis

worker:
image: codecov/enterprise-worker:latest-stable #note: this is for setup purposes only, be sure to pin to the latest release from our changelog: https://docs.codecov.io/changelog
command: worker
volumes:
- ./config:/config
- archive-volume:/archive
networks:
- codecov
depends_on:
- minio
- redis
- postgres
- timescale

redis:
image: redis:6-alpine
volumes:
- redis-volume:/data
networks:
- codecov

postgres:
image: postgres:14-alpine
environment:
- POSTGRES_PASSWORD=testpassword
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- postgres-volume:/var/lib/postgresql/data
ports:
- "9432:5432"
networks:
- codecov

timescale:
image: timescale/timescaledb-ha:pg14-latest
environment:
- POSTGRES_PASSWORD=testpassword
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- timescale-volume:/var/lib/postgresql/data
ports:
- "8432:5432"
networks:
- codecov

minio:
image: minio/minio:RELEASE.2020-04-15T00-39-01Z
command: server /export
ports:
- "${CODECOV_MINIO_PORT-9000}:9000"
environment:
- MINIO_ACCESS_KEY=codecov-default-key
- MINIO_SECRET_KEY=codecov-default-secret
volumes:
- archive-volume:/export
networks:
- codecov

volumes:
postgres-volume:
timescale-volume:
redis-volume:
archive-volume:

networks:
codecov:
driver: bridge
6 changes: 6 additions & 0 deletions m1-build-fix/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM --platform=linux/amd64 codecov/enterprise-api:latest-stable

USER root
RUN apk update && apk add openssl postgresql libgcc libstdc++ ncurses-libs
RUN ln -s /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s-a04fdf82.so.1
USER codecov
3 changes: 3 additions & 0 deletions m1-build-fix/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Mac M1 Fix for API

On an M1 Mac, there are some issues running the API. This dockerfile serves as a shim for that. The example docker-compose files include a commented out usage of this file. Just uncomment and run.
30 changes: 30 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Self-Hosted Codecov
> Code coverage done right.® Empower your developers with Codecov to improve code quality.
Testing software is crucial for deploying healthy code. Codecov provides metrics and insight in the results of tests through code coverage reports. Coverage reports are used to determine what lines of code were tested and what lines were missed entirely. These reports are uploaded to Codecov to be analyzed and stored historically. This information helps your developers save time tracking down bugs and commit stronger code that is well tested, to increase code coverage to 100%.

### Features

Commit statuses and pull request comments are key to maintaining a healthy product. Codecov provides valuable metrics in the pull request feed and promotes healthy development.

Our unique Coverage Diff® will describe the commit in relation to its impact on tests which significantly improves code reviews.

### Usage

This repo is meant for a quick POC that can be ran locally. It is recommended to use Helm or Terraform to deploy Codecov in production.

Codecov currently requires your team to use one or more of the following: GitHub, GitHub Enterprise, GitLab, Gitlab CE, GitLab Enterprise, Bitbucket and Bitbucket Server (formerly Stash).

- **Website** https://codecov.io
- **Phone number** 1 (415) 854-9184
- **Valid company email** [[email protected]][email]
- **Company icon/logo** https://github.com/codecov/media/tree/master/logos
- **Product icon/logo** https://github.com/codecov/media/tree/master/logos
- **Support link** https://codecov.io/support
- **License link** https://about.codecov.io/eula
- **Screenshots**
- **Search tags** code coverage, static analysis, dev-ops, continuous integration, software development, developer tools

[config]: http://docs.codecov.io/docs/configuration
[email]: mailto:[email protected]
[eula]: https://about.codecov.io/eula
9 changes: 9 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -eu

NEW_VERSION="$1"

sed -i -e "s/^\# Self-Hosted Codecov .*/# Self-Hosted Codecov $NEW_VERSION/" README.md
sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d')/" LICENSE

echo "New version: $NEW_VERSION"

0 comments on commit 0f9c0c4

Please sign in to comment.