Skip to content

Commit 4f854aa

Browse files
first commit
0 parents  commit 4f854aa

File tree

212 files changed

+9384
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+9384
-0
lines changed

.circleci/config.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
version: 2.1
2+
3+
orbs:
4+
codecov: codecov/codecov@1
5+
snyk: snyk/[email protected]
6+
7+
executors:
8+
java:
9+
docker:
10+
- image: cimg/openjdk:11.0
11+
helm:
12+
docker:
13+
- image: hypertrace/helm-gcs-packager:0.1.1
14+
commands:
15+
gradle:
16+
description: 'Run the provided gradle command'
17+
parameters:
18+
args:
19+
type: string
20+
when:
21+
default: "on_success"
22+
type: enum
23+
enum: ["on_fail", "on_success", "always"]
24+
steps:
25+
- run:
26+
name: << parameters.args >>
27+
command: ./gradlew << parameters.args >> --info --max-workers=2 -Dorg.gradle.jvmargs=-Xmx2g -Dorg.gradle.console=plain --continue
28+
when: << parameters.when >>
29+
setup_build_environment:
30+
description: 'Generates cache key from a hash of all gradle files'
31+
steps:
32+
- checkout
33+
- run:
34+
name: Generate cache key
35+
command: find . -type f -name "*.gradle*" -exec shasum {} + | sort > /tmp/checksum.txt && cat /tmp/checksum.txt
36+
- restore_cache:
37+
keys:
38+
- v1-dependencies-{{ checksum "/tmp/checksum.txt" }}
39+
# fallback to using the latest cache if no exact match is found
40+
- v1-dependencies-
41+
populate_and_save_cache:
42+
description: 'Downloads all gradle dependencies and uploads cache for later use'
43+
steps:
44+
- gradle:
45+
args: downloadDependencies
46+
- save_cache:
47+
paths:
48+
- ~/.gradle
49+
key: v1-dependencies-{{ checksum "/tmp/checksum.txt" }}
50+
51+
jobs:
52+
build:
53+
executor: java
54+
steps:
55+
- setup_build_environment
56+
- setup_remote_docker
57+
- populate_and_save_cache
58+
- gradle:
59+
args: build dockerBuildImages
60+
- gradle:
61+
args: jacocoTestReport
62+
- gradle:
63+
args: copyAllReports --output-dir=/tmp/test-reports
64+
when: always
65+
- codecov/upload
66+
- store_test_results:
67+
path: /tmp/test-reports
68+
- store_artifacts:
69+
path: /tmp/test-reports
70+
destination: reports
71+
snyk-scan:
72+
executor: java
73+
environment:
74+
GRADLE_OPTS: -Dorg.gradle.workers.max=1 # Snyk doesn't handle parallelism well
75+
steps:
76+
- setup_build_environment
77+
- snyk/scan:
78+
additional-arguments: --all-sub-projects
79+
80+
publish:
81+
executor: java
82+
steps:
83+
- setup_build_environment
84+
- setup_remote_docker
85+
- gradle:
86+
args: :tag -Prelease
87+
- add_ssh_keys:
88+
fingerprints:
89+
- 'b9:bd:a2:02:5b:02:ec:2e:53:b4:de:f1:57:45:0a:e6'
90+
- run: git push origin $(./gradlew -q :printVersion)
91+
- gradle:
92+
args: dockerPushImages
93+
validate-charts:
94+
executor: helm
95+
steps:
96+
- checkout
97+
- run:
98+
name: Helm Charts Lint and Template Render
99+
command: |
100+
helm lint --strict ./helm/
101+
helm template ./helm/
102+
package-charts:
103+
executor: helm
104+
steps:
105+
- checkout
106+
- run:
107+
name: Package and Publish Helm Charts
108+
command: |
109+
CHART_VERSION=$(git describe --abbrev=0)
110+
CHART_NAME=$(awk '/^name:/ {print $2}' ./helm/Chart.yaml)
111+
export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/helm-gcs-key.json
112+
echo ${HELM_GCS_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS}
113+
helm dependency update ./helm/
114+
helm repo add helm-gcs ${HELM_GCS_REPOSITORY}
115+
helm package --version ${CHART_VERSION} --app-version ${CHART_VERSION} ./helm/
116+
helm gcs push ${CHART_NAME}-${CHART_VERSION}.tgz helm-gcs --public --retry
117+
118+
workflows:
119+
version: 2
120+
build-and-publish:
121+
jobs:
122+
- build
123+
- validate-charts
124+
- snyk-scan:
125+
context: hypertrace-vulnerability-scanning
126+
- publish:
127+
context: hypertrace-publishing
128+
requires:
129+
- build
130+
- snyk-scan
131+
- validate-charts
132+
filters:
133+
branches:
134+
only:
135+
- master
136+
- package-charts:
137+
context: hypertrace-publishing
138+
requires:
139+
- publish
140+
filters:
141+
branches:
142+
only:
143+
- master

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Each line is a file pattern followed by one or more owners.
2+
3+
# global
4+
* @aaron-steinfeld @tim-mwangi

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
6+
7+
.idea

0 commit comments

Comments
 (0)