Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/jersey-main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI jersey-main
on:
push:
branches: [ main, dev ]
branches: [ master, dev ]
pull_request:
branches: [ main, dev ]
branches: [ master, dev ]

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jersey-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/microservices-main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI microservices-main
on:
push:
branches: [ main, dev ]
branches: [ master, dev ]
pull_request:
branches: [ main, dev ]
branches: [ master, dev ]

jobs:
build:
Expand Down Expand Up @@ -247,5 +247,5 @@ jobs:
if: always()
with:
name: integration-test-logs
path: appserver-jersey/build/container-logs/
path: microservices/integration-tests/build/container-logs/
retention-days: 7
9 changes: 5 additions & 4 deletions .github/workflows/microservices-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Appserver Jersey Release
name: Appserver Microservices Release

on:
release:
Expand All @@ -7,7 +7,6 @@ on:
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
IMAGE_NAME: radar-appserver

jobs:
upload:
Expand Down Expand Up @@ -65,7 +64,7 @@ jobs:
- cloud-messaging-service

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-java@v5
with:
Expand All @@ -89,8 +88,10 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase image name
env:
MODULE: ${{ matrix.service }}
run: |
echo "DOCKER_IMAGE=${REGISTRY}/${REPOSITORY,,}/${IMAGE_NAME}" >>${GITHUB_ENV}
echo "DOCKER_IMAGE=${REGISTRY}/${REPOSITORY,,}/${MODULE}" >>${GITHUB_ENV}

# Add Docker labels and tags
- name: Docker meta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ package org.radarbase.appserver.jersey.config

data class LiquibaseConfig(
val enabled: Boolean = false,
val changelogs: String = "db/changelog/db.changelog-master.yaml",
)
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class AppserverResourceEnhancerFactory(private val config: AppserverConfig) : En
properties = config.db.additionalProperties,
liquibase = org.radarbase.jersey.hibernate.config.LiquibaseConfig(
enable = config.db.liquibase.enabled,
changelogs = config.db.liquibase.changelogs,
),
)

Expand Down
9 changes: 7 additions & 2 deletions appserver-jersey/src/main/resources/appserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@ auth:
resourceName: res_AppServer

db:
# For Development environment, use H2 database.
# For Development environment, use H2 database with drop-and-create:
# jdbcDriver: org.h2.Driver
# jdbcUrl: jdbc:h2:mem:dev
# hibernateDialect: org.hibernate.dialect.H2Dialect
# liquibase:
# enabled: false
# additionalProperties:
# jakarta.persistence.schema-generation.database.action: drop-and-create
additionalProperties:
jakarta.persistence.schema-generation.database.action: drop-and-create
hibernate.hbm2ddl.auto: validate
# hibernate.show_sql: true
# hibernate.format_sql: true
jdbcDriver: org.postgresql.Driver
jdbcUrl: jdbc:postgresql://localhost:5432/appserver
hibernateDialect: org.hibernate.dialect.PostgreSQLDialect
username: radar
password: radar
liquibase:
enabled: true
changelogs: db/changelog/db.changelog-master.yaml

# GitHub configuration.
github:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
databaseChangeLog:
- changeSet:
id: 1543511610622-1
author: yatharth (generated)
changes:
- createSequence:
sequenceName: hibernate_sequence
- changeSet:
id: 1543511610622-2
author: yatharth (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
primaryKey: true
primaryKeyName: notificationsPK
name: id
type: BIGINT
- column:
constraints:
nullable: false
name: created_at
type: timestamp
- column:
constraints:
nullable: false
name: updated_at
type: timestamp
- column:
name: app_package
type: VARCHAR(255)
- column:
name: body
type: VARCHAR(255)
- column:
constraints:
nullable: false
name: delivered
type: BOOLEAN
- column:
name: dry_run
type: BOOLEAN
- column:
name: fcm_message_id
type: VARCHAR(255)
- column:
name: fcm_topic
type: VARCHAR(255)
- column:
constraints:
nullable: false
name: scheduled_time
type: timestamp
- column:
name: source_id
type: VARCHAR(255)
- column:
name: source_type
type: VARCHAR(255)
- column:
constraints:
nullable: false
name: title
type: VARCHAR(255)
- column:
name: ttl_seconds
type: INT
- column:
name: type
type: VARCHAR(255)
- column:
constraints:
nullable: false
name: validated
type: BOOLEAN
- column:
constraints:
nullable: false
name: user_id
type: BIGINT
tableName: notifications
- changeSet:
id: 1543511610622-3
author: yatharth (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
primaryKey: true
primaryKeyName: projectsPK
name: id
type: BIGINT
- column:
constraints:
nullable: false
name: created_at
type: timestamp
- column:
constraints:
nullable: false
name: updated_at
type: timestamp
- column:
constraints:
nullable: false
name: project_id
type: VARCHAR(255)
tableName: projects
- changeSet:
id: 1543511610622-4
author: yatharth (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
primaryKey: true
primaryKeyName: user_metricsPK
name: id
type: BIGINT
- column:
constraints:
nullable: false
name: created_at
type: timestamp
- column:
constraints:
nullable: false
name: updated_at
type: timestamp
- column:
name: last_delivered
type: timestamp
- column:
name: last_opened
type: timestamp
- column:
name: user_id
type: BIGINT
tableName: user_metrics
- changeSet:
id: 1543511610622-5
author: yatharth (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
primaryKey: true
primaryKeyName: usersPK
name: id
type: BIGINT
- column:
constraints:
nullable: false
name: created_at
type: timestamp
- column:
constraints:
nullable: false
name: updated_at
type: timestamp
- column:
name: enrolment_date
type: timestamp
- column:
constraints:
nullable: false
name: fcm_token
type: VARCHAR(255)
- column:
constraints:
nullable: false
name: subject_id
type: VARCHAR(255)
- column:
name: timezone
type: DOUBLE
- column:
constraints:
nullable: false
name: project_id
type: BIGINT
- column:
name: usermetrics_id
type: BIGINT
tableName: users
- changeSet:
id: 1543511610622-6
author: yatharth (generated)
changes:
- addUniqueConstraint:
columnNames: project_id
constraintName: UC_PROJECTSPROJECT_ID_COL
tableName: projects
- changeSet:
id: 1543511610622-7
author: yatharth (generated)
changes:
- addUniqueConstraint:
columnNames: user_id, source_id, scheduled_time, title, body, type, ttl_seconds,
delivered, dry_run
constraintName: UKjdp6comtocl1fyipmur1fuo1h
tableName: notifications
- changeSet:
id: 1543511610622-8
author: yatharth (generated)
changes:
- addUniqueConstraint:
columnNames: subject_id, fcm_token, project_id
constraintName: UKmm6u3xspqfqoolkjhsvdrqefq
tableName: users
- changeSet:
id: 1543511610622-9
author: yatharth (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: user_id
baseTableName: user_metrics
constraintName: FK65c9asnnjs3q0lktqj103mvcv
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: users
validate: true
- changeSet:
id: 1543511610622-10
author: yatharth (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: user_id
baseTableName: notifications
constraintName: FK9y21adhxn0ayjhfocscqox7bh
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: users
validate: true
- changeSet:
id: 1543511610622-11
author: yatharth (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: usermetrics_id
baseTableName: users
constraintName: FKf3dy0yvpkkwtrxj8hutlt8615
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: user_metrics
validate: true
- changeSet:
id: 1543511610622-12
author: yatharth (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: project_id
baseTableName: users
constraintName: FKj4xjs6i0exxcgearpuykol477
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: projects
validate: true

Loading
Loading