-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XENOPS-1128 add check for content store fetching file to health check (…
…#22) * XENOPS-1128 add check for content stora fetching file to health check * XENOPS-1128 add check for content stora fetching file to health check * XENOPS-1128 add check for content stora fetching file to health check * XENOPS-1128 add more testing for details * XENOPS-1128 change the way to access the noderef for content store to a constant
- Loading branch information
1 parent
d04057e
commit 899c2e1
Showing
52 changed files
with
583 additions
and
463 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 |
---|---|---|
@@ -1,58 +1,59 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
pull_request: | ||
workflow_dispatch: | ||
env: | ||
GRADLE_OPTS: "-Dorg.gradle.project.org.alfresco.artifacts.username=${{ secrets.ALFRESCO_NEXUS_USERNAME }} -Dorg.gradle.project.org.alfresco.artifacts.password=${{ secrets.ALFRESCO_NEXUS_PASSWORD }}" | ||
GRADLE_OPTS: >- | ||
-Dorg.gradle.project.org.alfresco.maven.nexus.username=${{ secrets.ALFRESCO_NEXUS_USERNAME }} | ||
-Dorg.gradle.project.org.alfresco.maven.nexus.password=${{ secrets.ALFRESCO_NEXUS_PASSWORD }} | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavour: [ "community", "enterprise" ] | ||
version: [ "61", "62", "70", "71", "72", "73" ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v1 | ||
distribution: 'temurin' | ||
java-version: '11' | ||
- name: Login to Docker | ||
run: echo "${{ secrets.CLOUDSMITH_APIKEY }}" | docker login private.docker.xenit.eu --username "${{ secrets.CLOUDSMITH_USER }}" --password-stdin | ||
- name: Integration Test | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
java-version: 11 | ||
- name: Login to CloudSmith docker registry | ||
env: | ||
DOCKER_USER: ${{ secrets.CLOUDSMITH_USER }} | ||
DOCKER_PASSWORD: ${{ secrets.CLOUDSMITH_APIKEY }} | ||
run: echo "$DOCKER_PASSWORD" | docker login docker.xenit.eu --username "$DOCKER_USER" --password-stdin | ||
- name: Integration test | ||
run: ./gradlew :integration-tests:alfresco-${{ matrix.flavour }}-${{ matrix.version }}:integrationTest --parallel | ||
- name: 'Upload Artifact' | ||
cache-read-only: false | ||
arguments: :integration-tests:alfresco-${{ matrix.flavour }}-${{ matrix.version }}:integrationTest --parallel | ||
- name: 'Upload Test Reports' | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-result-${{ matrix.flavour }}-${{ matrix.version }} | ||
path: /home/runner/work/**/build/reports | ||
retention-days: 2 | ||
path: /home/runner/**/build/reports | ||
retention-days: 14 | ||
publish: | ||
needs: [ test ] | ||
runs-on: ubuntu-latest | ||
if: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') }} | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v1 | ||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3 | ||
with: | ||
java-version: 11 | ||
distribution: 'temurin' | ||
java-version: '11' | ||
- name: Add TAG_VERSION env property | ||
run: echo "TAG_VERSION=`echo ${GITHUB_REF#refs/tags/}`" >> $GITHUB_ENV | ||
- name: Publish | ||
env: | ||
ORG_GRADLE_PROJECT_publish_username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
ORG_GRADLE_PROJECT_publish_password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }} | ||
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }} | ||
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }} | ||
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }} | ||
run: ./gradlew publish --info | ||
|
||
|
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
File renamed without changes.
Binary file added
BIN
+2.31 KB
...src/main/amp/config/alfresco/module/alfresco-actuators/bootstrap/AlfrescoActuatorsACP.acp
Binary file not shown.
28 changes: 28 additions & 0 deletions
28
...-actuators/src/main/amp/config/alfresco/module/alfresco-actuators/bootstrap/bootstrap.xml
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,28 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> | ||
<beans> | ||
<bean id="eu.xenit.actuators.bootstrap" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" | ||
parent="basePatch"> | ||
<property name="id"> | ||
<value>eu.xenit.alfresco-actuators.alfresco-actuators.filesLoader</value> | ||
</property> | ||
<property name="description" value="File used to verify the health of content store of alfresco"/> | ||
<property name="fixesFromSchema"> | ||
<value>0</value> | ||
</property> | ||
<property name="fixesToSchema"> | ||
<value>${version.schema}</value> | ||
</property> | ||
<property name="targetSchema"> | ||
<value>99999</value> | ||
</property> | ||
<property name="importerBootstrap" ref="spacesBootstrap"/> | ||
<property name="bootstrapView"> | ||
<props> | ||
<prop key="uuidBinding">UPDATE_EXISTING</prop> | ||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop> | ||
<prop key="location">alfresco/module/alfresco-actuators/bootstrap/AlfrescoActuatorsACP.acp</prop> | ||
</props> | ||
</property> | ||
</bean> | ||
</beans> |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...ig/alfresco/templates/webscripts/eu/xenit/actuators/webscripts/healthdetails.get.json.ftl
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 @@ | ||
${json} |
25 changes: 0 additions & 25 deletions
25
alfresco-actuators/src/main/java/eu/xenit/actuators/Health.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
alfresco-actuators/src/main/java/eu/xenit/actuators/HealthDetailsError.java
This file was deleted.
Oops, something went wrong.
21 changes: 19 additions & 2 deletions
21
alfresco-actuators/src/main/java/eu/xenit/actuators/HealthIndicator.java
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 |
---|---|---|
@@ -1,5 +1,22 @@ | ||
package eu.xenit.actuators; | ||
|
||
public interface HealthIndicator { | ||
Health isHealthy(); | ||
import eu.xenit.actuators.model.gen.HealthInfo; | ||
import eu.xenit.actuators.model.gen.StatusEnum; | ||
|
||
|
||
public abstract class HealthIndicator { | ||
public HealthInfo isHealthy() { | ||
HealthInfo health = new HealthInfo(); | ||
health.setName(this.getClass().getSimpleName()); | ||
try { | ||
health.setDetails(getHealthDetails()); | ||
health.setStatus(StatusEnum.UP); | ||
} catch (Exception exception) { | ||
health.setStatus(StatusEnum.DOWN); | ||
health.setError(exception.getMessage()); | ||
} | ||
return health; | ||
} | ||
|
||
protected abstract Object getHealthDetails() throws Exception; | ||
} |
Oops, something went wrong.