Skip to content

Commit

Permalink
Merge pull request #26 from RADAR-base/release-0.4.1
Browse files Browse the repository at this point in the history
Release 0.4.1
  • Loading branch information
blootsvoets authored Mar 3, 2022
2 parents bb512ba + 2374690 commit 5e80c42
Show file tree
Hide file tree
Showing 14 changed files with 797 additions and 102 deletions.
116 changes: 115 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [published]

jobs:
check:
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down Expand Up @@ -64,3 +64,117 @@ jobs:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew -Psigning.gnupg.keyName=${{ secrets.OSSRH_GPG_SECRET_KEY_ID }} -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} publish closeAndReleaseSonatypeStagingRepository

# Build and push tagged release backend docker image
dockerBackend:
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
DOCKER_IMAGE: radarbase/radar-app-config

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Add Docker labels and tags
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Setup docker build environment
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build backend docker
uses: docker/build-push-action@v2
with:
context: .
file: ./radar-app-config/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta_backend as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Joris Borgdorff <[email protected]>, Nivethika Mahasivam <[email protected]>
org.opencontainers.image.description=RADAR-base app config service
org.opencontainers.image.authors=Joris Borgdorff <[email protected]>, Nivethika Mahasivam <[email protected]>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
- name: Inspect docker image
run: |
docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
dockerFrontend:
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
DOCKER_IMAGE: radarbase/radar-app-config-frontend

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Add Docker labels and tags
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Setup docker build environment
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build frontend docker
uses: docker/build-push-action@v2
with:
context: ./radar-app-config-frontend
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta_backend as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Peyman Mohtashami <[email protected]>, Joris Borgdorff <[email protected]>
org.opencontainers.image.description=RADAR-base app config frontend
org.opencontainers.image.authors=Peyman Mohtashami <[email protected]>, Joris Borgdorff <[email protected]>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
- name: Inspect docker image
run: |
docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Run Snyk
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: snyk test --all-projects --org=radar-base --configuration-matching='^runtimeClasspath$' --exclude plugins/radar-android-empatica --json-file-output=${{ env.REPORT_FILE }}
run: snyk test --all-projects --org=radar-base --configuration-matching='^runtimeClasspath$' --json-file-output=${{ env.REPORT_FILE }}

- name: Report new vulnerabilities
uses: thehyve/report-vulnerability@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Run Snyk to check for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: snyk test --all-projects --org=radar-base --fail-on=upgradable --configuration-matching='^runtimeClasspath$'
run: snyk test --all-projects --org=radar-base --fail-on=upgradable --configuration-matching='^runtimeClasspath$'
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ plugins {

allprojects {
group = "org.radarbase"
version = "0.4.0"
version = "0.4.1"
}

val githubRepoName = "RADAR-base/radar-jersey"
val githubRepoName = "RADAR-base/radar-app-config"
val githubUrl = "https://github.com/$githubRepoName.git"
val githubIssueUrl = "https://github.com/$githubRepoName/issues"

Expand Down
29 changes: 29 additions & 0 deletions radar-app-config-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# App config client

Kotlin client library for the radar-app-config service. It uses OkHttp3 for communication and Jackson JSON parsing.
It may cache values.

Import it with:

```gradle
dependencies {
implementation("org.radarbase:radar-app-config-client:<release version>")
}
```

Example use:

```kotlin
data class MyConfig(val paramA: String?)

val appConfigClient = AppConfigClient(object : TypeReference<MyConfig>() {}) {
appConfigUrl(appConfigUrl)
tokenUrl(authConfig.tokenUrl)
clientId = authConfig.clientId
clientSecret = authConfig.clientSecret
}

val myConfig = appConfigClient.getUserConfig(projectId, userId)
val newConfig = updateConfig(myConfig)
appConfigClient.setUserConfig(projectId, userId, newConfig)
```
Loading

0 comments on commit 5e80c42

Please sign in to comment.