-
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
Showing
9 changed files
with
207 additions
and
45 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,63 @@ | ||
# SPDX-FileCopyrightText: Contributors to the GXF project | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build Pipeline | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
tags: [ "v**" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
# TODO remove after testing | ||
# - name: Set up JDK 17 | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: '17' | ||
# distribution: 'temurin' | ||
# - name: Setup Gradle to generate and submit dependency graphs | ||
# uses: gradle/[email protected] | ||
# with: | ||
# dependency-graph: generate-and-submit | ||
# - name: Build with Gradle | ||
# run: ./gradlew build integrationTest bootBuildImage | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# - name: Run sonar analysis with Gradle | ||
# run: ./gradlew sonar | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
# - name: Publish Docker image | ||
# if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' | ||
# run: ./gradlew bootBuildImage -PpublishImage | ||
# env: | ||
# GITHUB_ACTOR: ${{ github.actor }} | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.12.0 | ||
# TODO install and publish cr without creating a new release | ||
- name: Publish Helm chart | ||
uses: helm/[email protected] | ||
# if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' | ||
with: | ||
charts_dir: ./ | ||
packages_with_index: true | ||
env: | ||
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
apiVersion: v2 | ||
name: gxf-service-template | ||
type: application | ||
version: 0.1.0 |
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,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Values.name }}-config | ||
data: | ||
SPRING_APPLICATION_JSON: {{ .Values.springConfig | toJson | quote }} |
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,80 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.name }} | ||
labels: | ||
app: {{ .Values.name }} | ||
spec: | ||
replicas: {{ .Values.deployment.replicas }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.name }} | ||
template: | ||
metadata: | ||
name: {{ .Values.name }} | ||
annotations: | ||
prometheus.io/port: '8080' | ||
prometheus.io/path: '/actuator/prometheus' | ||
prometheus.io/scrape: 'true' | ||
labels: | ||
app: {{ .Values.name }} | ||
{{- range $key, $value := .Values.deployment.labels }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ .Values.serviceAccount.name | default $.Values.name }} | ||
restartPolicy: Always | ||
{{- with .Values.deployment.secrets.imagePullSecret }} | ||
imagePullSecrets: | ||
- name: {{ . }} | ||
{{- end }} | ||
containers: | ||
- name: processor | ||
image: "{{ .Values.deployment.image }}:{{ required ".Values.deployment.imageTag is required" .Values.deployment.imageTag }}" | ||
envFrom: | ||
- configMapRef: | ||
name: {{ .Values.name }}-config | ||
env: | ||
{{- range .Values.deployment.secrets.environment }} | ||
- name: {{ .envVariable }} | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .secretName }} | ||
key: {{ .secretKey }} | ||
{{- end }} | ||
{{- with .Values.deployment.resources }} | ||
resources: | ||
requests: | ||
cpu: {{ .requests.cpu }} | ||
{{/* For Java applications requests and limits should be equal */}} | ||
memory: {{ .limits.memory }} | ||
limits: | ||
cpu: {{ .limits.cpu }} | ||
memory: {{ .limits.memory }} | ||
{{- end }} | ||
ports: | ||
- name: actuator | ||
containerPort: 8080 | ||
startupProbe: | ||
httpGet: | ||
path: /actuator/health/liveness | ||
port: actuator | ||
failureThreshold: 30 | ||
periodSeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /actuator/health/liveness | ||
port: actuator | ||
failureThreshold: 4 | ||
periodSeconds: 15 | ||
volumeMounts: | ||
{{- range .Values.deployment.secrets.volumes }} | ||
- name: {{ .secretName }} | ||
mountPath: {{ .path }} | ||
{{- end }} | ||
volumes: | ||
{{- range .Values.deployment.secrets.volumes }} | ||
- name: {{ .secretName }} | ||
secret: | ||
secretName: {{ .secretName }} | ||
{{- end }} |
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,6 @@ | ||
{{- with .Values.serviceAccount }} | ||
apiVersion: {{ .apiVersion }} | ||
kind: {{ .kind }} | ||
metadata: | ||
name: {{ .name | default $.Values.name }} | ||
{{- end }} |
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,48 @@ | ||
name: gxf-service-template | ||
|
||
serviceAccount: | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
|
||
deployment: | ||
image: "ghcr.io/osgp/gxf-service-template" | ||
replicas: 1 | ||
resources: | ||
requests: | ||
cpu: 200m | ||
limits: | ||
cpu: 2 | ||
memory: 1Gi | ||
|
||
labels: | ||
label-one: 'true' | ||
label-two: 'false' | ||
|
||
secrets: | ||
imagePullSecret: "image-pull-secret" | ||
volumes: | ||
- secretName: "test-volume-one" | ||
path: "/etc/secret/one" | ||
- secretName: "test-volume-two" | ||
path: "/etc/secret/two" | ||
environment: | ||
- envVariable: "SPRING_DATASOURCE_PASSWORD" | ||
secretName: "database-secret" | ||
secretKey: "password" | ||
- envVariable: "MQTT_PASSWORD" | ||
secretName: "mqtt-secret" | ||
secretKey: "password" | ||
|
||
springConfig: | ||
spring: | ||
profiles: | ||
active: "kafka-oauth" | ||
datasource: | ||
url: "jdbc:postgresql://postgres_database:5432/gxf_service_template" | ||
username: "gxf_service_template" | ||
kafka: | ||
bootstrap-servers: "kafka-server:9092" | ||
logging: | ||
level: | ||
org: | ||
gxf: "DEBUG" |
File renamed without changes.
File renamed without changes.