Skip to content

Commit

Permalink
Merge pull request #28 from simonyiszk/feature/automate-builds
Browse files Browse the repository at this point in the history
Automate builds
  • Loading branch information
Isti01 authored Aug 23, 2024
2 parents 428545a + 446015c commit 923305b
Show file tree
Hide file tree
Showing 69 changed files with 76 additions and 3,038 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Build with Gradle - Backend
working-directory: backend
run: sh ./gradlew clean build
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

- name: Build with Gradle - Backend
working-directory: backend
run: sh ./gradlew clean build
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Create and publish native image

on:
push:
branches: [ 'master' ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

- name: Build with Gradle - Backend
working-directory: backend
run: sh ./gradlew clean bootBuildImage --imageName=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Push image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Run the following commands in the root directory of the project:

```bash
cd backend
./gradlew clean bootBuildImage --imageName=kir-dev/paybasz && docker-compose up -d
docker-compose up -d
```

If you deploy on lois with certbot and NGINX, it's better to disable `server.ssl.enabled` in the backend `application.properties` files.
Expand Down Expand Up @@ -188,5 +188,3 @@ There was a live testing this summer. It took place at the TTNY summer camp.
- More gateway debug possibilities needed
- Named items (eg.: #117 -> "Napi menü" 650 JMF / 5dl)
- Export to unique email per user


7 changes: 7 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ kotlin {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}

tasks.getByName<org.springframework.boot.gradle.tasks.bundling.BootBuildImage>("bootBuildImage") {
environment.put(
"BP_NATIVE_IMAGE_BUILD_ARGUMENTS",
"${environment.get()["BP_NATIVE_IMAGE_BUILD_ARGUMENTS"] ?: ""} -march=compatibility"
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ class AnalyticsAdminController(
transactionVolume = transactionService.getTransactionVolume()
)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties

@EnableConfigurationProperties
@ConfigurationProperties(prefix = "hu.bme.sch.paybasz.backend")
data class BackendConfig(val frontendUrl: String)
data class BackendConfig(val frontendUrl: String)
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ class OrderEventListener(private val eventService: EventService) {
private fun displayVoucher(voucher: Voucher) =
"Számlaazonosító: ${voucher.accountId}, Termékazonosító: ${voucher.itemId}, Darabszám: ${voucher.count}"

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ class PrincipalEventListener(private val eventService: EventService) {
}
}"

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class PrincipalLastUseUpdater(private val principalService: PrincipalService) {
principalService.updateLastUsed(event.principal.id)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.springframework.modulith.ApplicationModule


@ApplicationModule
@Table("transactions",)
@Table("transactions")
data class Transaction(
@Id @Column() var id: Int?,
val type: TransactionType,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
networks:
- network-x
backend-x:
image: kir-dev/paybasz:latest
image: ghcr.io/simonyiszk/paybasz-next:latest
env_file:
- .env
environment:
Expand Down
14 changes: 0 additions & 14 deletions docs/README.md

This file was deleted.

Binary file removed docs/backend_add_user.png
Binary file not shown.
Binary file removed docs/backend_analitics.png
Binary file not shown.
Binary file removed docs/backend_export.png
Binary file not shown.
Binary file removed docs/backend_gateways.png
Binary file not shown.
Binary file removed docs/backend_payment.png
Binary file not shown.
Binary file removed docs/backend_transactions.png
Binary file not shown.
Binary file removed docs/backend_upload.png
Binary file not shown.
Binary file removed docs/backend_users.png
Binary file not shown.
Binary file removed docs/buzzer_preview.png
Binary file not shown.
Binary file removed docs/esp32_preview.png
Binary file not shown.
Binary file removed docs/keypad_preview.png
Binary file not shown.
Binary file removed docs/oled_preview.png
Binary file not shown.
Binary file removed docs/proto1_preview1.jpg
Binary file not shown.
Binary file removed docs/proto1_preview2.jpg
Binary file not shown.
Binary file removed docs/proto1_preview3.jpg
Binary file not shown.
Binary file removed docs/proto2_preview1.jpg
Binary file not shown.
Binary file removed docs/proto2_preview2.jpg
Binary file not shown.
Binary file removed docs/proto2_preview3.jpg
Binary file not shown.
Binary file removed docs/rc522_preview.png
Binary file not shown.
9 changes: 0 additions & 9 deletions firmware/.gitignore

This file was deleted.

27 changes: 0 additions & 27 deletions firmware/Makefile

This file was deleted.

50 changes: 0 additions & 50 deletions firmware/docs/commands.md

This file was deleted.

Binary file removed firmware/docs/esp32_pinout.jpg
Binary file not shown.
Binary file removed firmware/docs/membran_switch.jpg
Binary file not shown.
Binary file removed firmware/docs/rc522_pinout.png
Binary file not shown.
Binary file removed firmware/docs/ssd1331-oled-display_pinout.jpg
Binary file not shown.
31 changes: 0 additions & 31 deletions firmware/graphics/banner.bitmap

This file was deleted.

Binary file removed firmware/graphics/banner.bmp
Binary file not shown.
Binary file removed firmware/graphics/banner.png
Binary file not shown.
Binary file removed firmware/graphics/banner_green.png
Binary file not shown.
Binary file removed firmware/graphics/banner_white.png
Diff not rendered.
48 changes: 0 additions & 48 deletions firmware/src/ArduinoSpi3.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions firmware/src/ArduinoSpi3.h

This file was deleted.

Loading

0 comments on commit 923305b

Please sign in to comment.