-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into error-strings
- Loading branch information
Showing
39 changed files
with
1,953 additions
and
933 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
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,14 @@ | ||
on: [pull_request] | ||
|
||
jobs: | ||
publiccode_yml_validation: | ||
runs-on: ubuntu-latest | ||
name: publiccode.yml validation | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: italia/publiccode-parser-action@v1 | ||
with: | ||
publiccode: 'publiccode.yml' | ||
comment-on-pr: true | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,41 @@ | ||
# Push the staging Docker image (ghcr.italia/developers-italia-api:main) | ||
# on updates to main. | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: | ||
# To push Docker images to GitHub | ||
packages: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- | ||
uses: actions/checkout@v3 | ||
with: | ||
# All history, required for goreleaser | ||
fetch-depth: 0 | ||
- | ||
# FIXME: goreleaser should already take care of the login | ||
# (see https://github.com/goreleaser/goreleaser/blame/02a3486d4ba59505113a57b438ae567351ed3dab/scripts/entrypoint.sh#L17) | ||
# but it doesn't work for some reason. | ||
run: echo "$GITHUB_TOKEN" | docker login ghcr.io -u docker --password-stdin | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- | ||
# Tag with a temporary valid semantic version. This is required by goreleaser. | ||
run: git tag v0-main-$(git rev-parse --short HEAD) | ||
|
||
- | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: v1.9.2 | ||
args: release --config .goreleaser.staging.yaml |
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
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
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
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,32 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
tests-postgresql: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
db: | ||
image: postgres:14 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: test | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- run: go test -race ./... | ||
env: | ||
DATABASE_DSN: "postgres://postgres:postgres@localhost:5432/test?sslmode=disable" |
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
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
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,21 @@ | ||
# Goreleases configuration for staging builds, just builds and pushes | ||
# the Docker image for the main branch. | ||
# | ||
# Make sure to check the documentation at https://goreleaser.com | ||
|
||
# Don't create a GitHub release | ||
release: | ||
disable: true | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w | ||
goos: | ||
- linux | ||
dockers: | ||
- | ||
dockerfile: Dockerfile.goreleaser | ||
image_templates: | ||
- "ghcr.io/italia/developers-italia-api:main" |
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
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
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
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
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
35 changes: 35 additions & 0 deletions
35
charts/developers-italia-api/templates/servicemonitor.yaml
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,35 @@ | ||
{{- if .Values.serviceMonitor.enabled -}} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ include "developers-italia-api.fullname" . }} | ||
labels: | ||
{{- include "developers-italia-api.labels" . | nindent 4 }} | ||
{{- if .Values.serviceMonitor.additionalLabels }} | ||
{{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- port: http | ||
{{- if .Values.serviceMonitor.interval }} | ||
interval: {{ .Values.serviceMonitor.interval }} | ||
{{- end }} | ||
{{- if .Values.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} | ||
{{- end }} | ||
{{- if .Values.serviceMonitor.jobLabel }} | ||
jobLabel: {{ .Values.serviceMonitor.jobLabel | quote }} | ||
{{- end }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
{{- if .Values.serviceMonitor.targetLabels }} | ||
targetLabels: | ||
{{- range .Values.serviceMonitor.targetLabels }} | ||
- {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "developers-italia-api.selectorLabels" . | nindent 6 }} | ||
{{- end }} |
Oops, something went wrong.