Skip to content

Commit 15c2ec9

Browse files
committed
fix for mongo connection string, added github actions and s2i configs, and updated health check endpoints
1 parent f1875c7 commit 15c2ec9

File tree

7 files changed

+143
-3
lines changed

7 files changed

+143
-3
lines changed

.github/workflows/ci-cd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Container
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
if: github.repository == 'rht-labs/lodestar-atifacts'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Set up JDK
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 13.0.1
20+
- name: Cache SonarCloud packages
21+
uses: actions/cache@v1
22+
with:
23+
path: ~/.sonar/cache
24+
key: ${{ runner.os }}-sonar
25+
restore-keys: ${{ runner.os }}-sonar
26+
- name: SonarCloud Static Analysis
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
30+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
31+
- name: Find and Replace Commit
32+
uses: jacobtomlinson/[email protected]
33+
with:
34+
find: "###GIT_COMMIT###"
35+
replace: "${{ github.sha }}"
36+
include: ".s2i"
37+
- uses: redhat-cop/github-actions/s2i@v2
38+
with:
39+
base: registry.access.redhat.com/ubi8/openjdk-11:1.3
40+
output_image: "quay.io/rht-labs/lodestar-artifacts:${{ github.sha }}"
41+
image_push_registry: quay.io
42+
image_push_username: ${{ secrets.QUAY_USERNAME }}
43+
image_push_password: ${{ secrets.QUAY_PASSWORD }}
44+
image_tags: main
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: PR check without code changes
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "!**"
7+
- deployment/**
8+
- README.md
9+
- lombok.config
10+
- .gitignore
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Skip build
17+
run: echo "This build has been skipped because the only changes are in non-code directories."
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: PR check
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- deployment/**
7+
- README.md
8+
- lombok.config
9+
- .gitignore
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up JDK
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 13.0.1
20+
- name: Build with Maven & Quarkus
21+
run: mvn test -q

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Add Tags to Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-if-needed:
9+
if: github.repository == 'rht-labs/lodestar-artifacts'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check whether we need to build this or not
13+
id: need_to_build
14+
run: |
15+
function image_exists() {
16+
curl --silent -f -lSL https://quay.io/v1/repositories/rht-labs/lodestar-artifacts/tags/$1 > /dev/null
17+
}
18+
if image_exists ${{ github.sha }}; then
19+
echo "Image exists - not building"
20+
echo ::set-output name=need_to_build::0
21+
else
22+
echo "Image needs to be built"
23+
echo ::set-output name=need_to_build::1
24+
fi
25+
- uses: actions/checkout@v2
26+
if: steps.need_to_build.outputs.need_to_build == 1
27+
- uses: redhat-cop/github-actions/s2i@v2
28+
if: steps.need_to_build.outputs.need_to_build == 1
29+
with:
30+
base: registry.access.redhat.com/ubi8/openjdk-11:1.3
31+
output_image: "quay.io/rht-labs/lodestar-artifacts:${{ github.sha }}"
32+
image_push_registry: quay.io
33+
image_push_username: ${{ secrets.QUAY_USERNAME }}
34+
image_push_password: ${{ secrets.QUAY_PASSWORD }}
35+
36+
release:
37+
runs-on: ubuntu-latest
38+
needs: build-if-needed
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: tag with release version
42+
uses: tinact/[email protected]
43+
with:
44+
image_name: rht-labs/lodestar-artifacts
45+
image_old_tag: ${{ github.sha }}
46+
image_new_tag: ${{ github.event.release.tag_name }}
47+
registry: quay.io
48+
registry_username: ${{ secrets.QUAY_USERNAME }}
49+
registry_password: ${{ secrets.QUAY_PASSWORD }}
50+
- name: tag with latest
51+
uses: tinact/[email protected]
52+
with:
53+
image_name: rht-labs/lodestar-artifacts
54+
image_old_tag: ${{ github.sha }}
55+
registry: quay.io
56+
registry_username: ${{ secrets.QUAY_USERNAME }}
57+
registry_password: ${{ secrets.QUAY_PASSWORD }}

.s2i/environment

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
LODESTAR_ACTIVITY_GIT_COMMIT=###GIT_COMMIT###

deployment/templates/deploymentconfig.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
value: {{ .Values.imageTag }}
3636
readinessProbe:
3737
httpGet:
38-
path: /health/ready
38+
path: /q/health/ready
3939
port: 8080
4040
scheme: HTTP
4141
timeoutSeconds: 1
@@ -44,7 +44,7 @@ spec:
4444
failureThreshold: 3
4545
livenessProbe:
4646
httpGet:
47-
path: /health/live
47+
path: /q/health/live
4848
port: 8080
4949
scheme: HTTP
5050
timeoutSeconds: 1

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mongo.password=${MONGODB_PASSWORD:mongopassword}
1818
mongo.service.name=${DATABASE_SERVICE_NAME:localhost:27017}
1919
quarkus.mongodb.database=${MONGODB_DATABASE:artifacts}
2020

21-
quarkus.mongodb.connection-string=mongodb://${mongo.user}:${mongo.password}@${mongo.service.name}/${quarkus.mongodb.database}?uuidRepresentation=javaLegacy&authSource=admin
21+
quarkus.mongodb.connection-string=mongodb://${mongo.user}:${mongo.password}@${mongo.service.name}/${quarkus.mongodb.database}?uuidRepresentation=javaLegacy
2222

2323
%test.quarkus.mongodb.connection-string=mongodb://${mongo.service.name}/${quarkus.mongodb.database}?uuidRepresentation=javaLegacy
2424
%test.quarkus.mongodb.write-concern.journal=false

0 commit comments

Comments
 (0)