Skip to content

Commit

Permalink
Merge branch 'main' into droidcon/tamzi-readmeupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
tamzi authored Jul 4, 2024
2 parents 821ac78 + cc21044 commit 61fed22
Show file tree
Hide file tree
Showing 27 changed files with 1,220 additions and 1,062 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ execute jar (jolo)
The last step started the remote webserver on port 80, with root rights. 🤓

Ponder docker, k8n, virtualization and more fancy devops things, and then give up thinking you are a mobile dev ops. Unless you are, then [youre help is needed](https://github.com/gdg-berlin-android/ZeBadge/issues/new).
## Building the WebApp with Docker

Just run the following docker commands to build and run the server.
```bash
docker build -t ze-server -f ./zeapp/Dockerfile ./zeapp
docker run -p 1337:1337 -p 433:433 ze-server:latest
```

Open the http://localhost:8080/ should display "yes" in the browser.


# Droidcon 2024 contribution guide:

Expand Down
15 changes: 15 additions & 0 deletions zeapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM eclipse-temurin:17 AS build

WORKDIR /app
COPY . .
RUN apt-get update && apt-get install -y git
RUN ./gradlew server:fatJar


FROM eclipse-temurin:17
WORKDIR /app
COPY --from=build /app/server/build/libs/server-1.0-SNAPSHOT-standalone.jar /app/server.jar
EXPOSE 1337
EXPOSE 433

CMD ["java", "-jar", "/app/server.jar"]
29 changes: 0 additions & 29 deletions zeapp/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import org.jetbrains.kotlin.incremental.createDirectory
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
import java.lang.ProcessBuilder.Redirect

plugins {
alias(libs.plugins.android.application)
Expand Down Expand Up @@ -233,33 +231,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs::class).confi
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
}

tasks.create("generateContributorsAsset") {
val command = "git shortlog -sne --all"
val process =
ProcessBuilder()
.command(command.split(" "))
.directory(rootProject.projectDir)
.redirectOutput(Redirect.PIPE)
.redirectError(Redirect.PIPE)
.start()
process.waitFor(60, TimeUnit.SECONDS)
val result = process.inputStream.bufferedReader().readText()

val contributors =
result
.lines()
.joinToString(separator = System.lineSeparator()) { it.substringAfter("\t") }

val assetDir =
layout.buildDirectory
.dir("generated/assets")
.get()
.asFile
assetDir.createDirectory()
File(assetDir, "test.txt").writeText(contributors)
}
tasks.getByName("build").dependsOn("generateContributorsAsset")

licenseReport {
generateHtmlReport = true
generateJsonReport = false
Expand Down
3 changes: 1 addition & 2 deletions zeapp/android/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>OptionalWhenBraces:ZeMainActivity.kt$is ZeConfiguration.Kodee -&gt; { vm.slotConfigured(editor.slot, config) }</ID>
<ID>OptionalWhenBraces:ZeMainActivity.kt$is ZeConfiguration.Quote -&gt; { RandomQuotesEditorDialog( accepted = { vm.slotConfigured(editor.slot, it) }, dismissed = { vm.slotConfigured(null, null) }, config = config, snackbarMessage = vm::showSnackBar, ) }</ID>
<ID>LongMethod:ZeScreen.kt$@Composable internal fun ZeScreen(vm: ZeBadgeViewModel, modifier: Modifier = Modifier)</ID>
<ID>OptionalWhenBraces:ZePreferencesService.kt$ZePreferencesService$ZeBadgeType.NAME -&gt; { ZeConfiguration.Name( name = slot.preferencesValue("name"), contact = slot.preferencesValue("contact"), bitmap = bitmap, ) }</ID>
<ID>OptionalWhenBraces:ZePreferencesService.kt$ZePreferencesService$is ZeConfiguration.CustomPhrase -&gt; { preferences[slot.preferencesKey("random_phrase")] = config.phrase }</ID>
<ID>OptionalWhenBraces:ZePreferencesService.kt$ZePreferencesService$is ZeConfiguration.ImageGen -&gt; { preferences[slot.preferencesKey("prompt")] = config.prompt }</ID>
Expand Down
Loading

0 comments on commit 61fed22

Please sign in to comment.