From 91be640508ed34c73af3605e454c3d8fdaf2e5e2 Mon Sep 17 00:00:00 2001 From: madhead Date: Sun, 17 Apr 2022 23:37:29 +0200 Subject: [PATCH] Add a stub for the herald Docker image --- .github/workflows/deploy.yml | 39 +++++++++++++++++++ herald/Dockerfile | 7 ++++ herald/README.adoc | 3 ++ herald/build.gradle.kts | 8 ++++ .../by/jprof/telegram/bot/herald/App.kt | 5 +++ settings.gradle.kts | 1 + 6 files changed, 63 insertions(+) create mode 100644 herald/Dockerfile create mode 100644 herald/README.adoc create mode 100644 herald/build.gradle.kts create mode 100644 herald/src/main/kotlin/by/jprof/telegram/bot/herald/App.kt diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e6ff0c16..21f56c0c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,3 +44,42 @@ jobs: - id: URL run: echo "::set-output name=URL::$(jq -r '.JProfByBotStack.URL' cdk.out/outputs.json)" working-directory: .deploy/lambda + + herald: + name: Herald + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 17 + + - uses: gradle/wrapper-validation-action@v1 + + - uses: gradle/gradle-build-action@v2 + with: + arguments: :herald:install + cache-read-only: ${{ github.ref != 'refs/heads/master' }} + + - uses: docker/metadata-action@v3 + id: metadata + with: + images: | + ghcr.io/${{ github.repository_owner }}/herald + flavor: | + latest=true + + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/build-push-action@v2 + with: + context: herald + push: true + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} diff --git a/herald/Dockerfile b/herald/Dockerfile new file mode 100644 index 00000000..7ab6c54d --- /dev/null +++ b/herald/Dockerfile @@ -0,0 +1,7 @@ +ARG JAVA=17 + +FROM openjdk:${JAVA} + +COPY build/install/* /opt/herald + +ENTRYPOINT ["/opt/herald/bin/herald"] diff --git a/herald/README.adoc b/herald/README.adoc new file mode 100644 index 00000000..3550de2f --- /dev/null +++ b/herald/README.adoc @@ -0,0 +1,3 @@ += Herald + +This feature posts scheduled messages to the chat. diff --git a/herald/build.gradle.kts b/herald/build.gradle.kts new file mode 100644 index 00000000..9f40d1fe --- /dev/null +++ b/herald/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + kotlin("jvm") + application +} + +application { + mainClass.set("by.jprof.telegram.bot.herald.AppKt") +} diff --git a/herald/src/main/kotlin/by/jprof/telegram/bot/herald/App.kt b/herald/src/main/kotlin/by/jprof/telegram/bot/herald/App.kt new file mode 100644 index 00000000..f9ab0277 --- /dev/null +++ b/herald/src/main/kotlin/by/jprof/telegram/bot/herald/App.kt @@ -0,0 +1,5 @@ +package by.jprof.telegram.bot.herald + +suspend fun main(args: Array) { + println("Hello, world!") +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 9a92a6bb..1a51f36b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,3 +30,4 @@ include(":pins:dynamodb") include(":pins:sfn") include(":runners:lambda") include(":currencies") +include(":herald")