-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f8f74f0
Showing
66 changed files
with
3,847 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
version: '3.x' | ||
|
||
- name: Test | ||
run: make test | ||
env: | ||
DB_URI_TEST_MONGO: ${{ secrets.DB_URI_TEST_MONGO }} | ||
|
||
- name: Registry login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_ACCESS_TOKEN }} | ||
|
||
- name: Release | ||
run: make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- "mistress" | ||
|
||
env: | ||
COMPONENT: metrics | ||
VERSION: latest | ||
CHART_VERSION: 0.0.0 | ||
|
||
jobs: | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Registry login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_ACCESS_TOKEN }} | ||
|
||
- name: Staging | ||
run: make staging | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.12.0 | ||
|
||
- name: Helm Lint | ||
run: | | ||
helm lint helm/${COMPONENT} | ||
- name: Helm Package | ||
run: | | ||
helm dependency update helm/${COMPONENT} | ||
helm package helm/${COMPONENT} | ||
- name: Google Cloud Auth | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GKE_SA_KEY }}' | ||
|
||
- uses: google-github-actions/setup-gcloud@v1 | ||
with: | ||
project_id: ${{ secrets.GKE_RPOJECT_ID }} | ||
|
||
- name: Kubeconfig | ||
run: | | ||
gcloud components install gke-gcloud-auth-plugin | ||
gcloud container clusters get-credentials ${{ secrets.GKE_CLUSTER_NAME_DEMO }} \ | ||
--region ${{ secrets.GKE_CLUSTER_REGION }} \ | ||
--project ${{ secrets.GKE_PROJECT_ID }} | ||
- name: Helm Upgrade | ||
run: | | ||
helm upgrade --install ${COMPONENT} ${COMPONENT}-0.0.0.tgz \ | ||
--values helm/metrics/values-awakari-com.yaml \ | ||
--set-string podAnnotations.commit=$(git rev-parse --short HEAD) \ | ||
--set limits.db.tls.enabled=true \ | ||
--set limits.db.tls.insecure=true \ | ||
--set permits.db.tls.enabled=true \ | ||
--set permits.db.tls.insecure=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
- "!mistress" | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
# repo-token is necessary to avoid the rate limit issue | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
version: "3.x" | ||
|
||
- name: Build | ||
run: make build | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
version: "3.x" | ||
|
||
- name: Test | ||
run: make test | ||
env: | ||
DB_URI_TEST_MONGO: ${{ secrets.DB_URI_TEST_MONGO }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
./metrics | ||
cover.tmp | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
**/*.pb.go | ||
|
||
ghcr_io_pat.txt | ||
*.key | ||
*.crt | ||
*.srl | ||
*.csr | ||
*.p12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.23.4-alpine3.20 AS builder | ||
WORKDIR /go/src/metrics | ||
COPY . . | ||
RUN \ | ||
apk add -U --no-cache \ | ||
protoc \ | ||
protobuf-dev \ | ||
make \ | ||
git \ | ||
ca-certificates && \ | ||
make build | ||
|
||
FROM scratch | ||
COPY --from=builder /go/src/metrics/metrics /bin/metrics | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
ENTRYPOINT ["/bin/metrics"] |
Oops, something went wrong.