From 1b59e02f539cb638152e540853a0a9da75d77f9c Mon Sep 17 00:00:00 2001 From: Gerrit Garbereder Date: Sat, 24 Jun 2023 19:25:09 +0300 Subject: [PATCH 1/6] Dockerfile added Add first basic docker file to compile the project. The image is not good yet, it does not cache enough. --- Dockerfile | 3 +++ build.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Dockerfile create mode 100644 build.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4340656 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM gradle:8-jdk17 +WORKDIR /dev/mnt +CMD ["./build.sh"] \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..b3c5616 --- /dev/null +++ b/build.sh @@ -0,0 +1,51 @@ +#!/bin/sh +chmod +x gradlew +cd Task-Tracker-Entities +if [ ! -d "gradle" ]; then + ln -s ../gradle +fi +if [ ! -e "gradlew" ]; then + ln -s ../gradlew +fi +./gradlew check +./gradlew publishToMavenLocal + +cd ../Task-Tracker-Entities-Impl +if [ ! -d "gradle" ]; then + ln -s ../gradle +fi +if [ ! -e "gradlew" ]; then + ln -s ../gradlew +fi +./gradlew check +./gradlew publishToMavenLocal + +cd ../Task-Tracker-Usecases +if [ ! -d "gradle" ]; then + ln -s ../gradle +fi +if [ ! -e "gradlew" ]; then + ln -s ../gradlew +fi +./gradlew check +./gradlew publishToMavenLocal + +cd ../Task-Tracker-Usecases-SQLite-Impl +if [ ! -d "gradle" ]; then + ln -s ../gradle +fi +if [ ! -e "gradlew" ]; then + ln -s ../gradlew +fi +./gradlew check +./gradlew publishToMavenLocal + +cd ../Task-Tracker-CLI +if [ ! -d "gradle" ]; then + ln -s ../gradle +fi +if [ ! -e "gradlew" ]; then + ln -s ../gradlew +fi +./gradlew check +./gradlew assembleDist \ No newline at end of file From 846b05f58b26bdb1376847a2c3ac67d93908d5bf Mon Sep 17 00:00:00 2001 From: Gerrit Garbereder Date: Sat, 24 Jun 2023 19:32:49 +0300 Subject: [PATCH 2/6] Use build.sh in build.yml --- .github/workflows/build.yml | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e17d17..208a411 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,32 +31,7 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Build with Gradle - run: | - chmod +x gradlew && - - cd Task-Tracker-Entities && - ln -s ../gradle && - ln -s ../gradlew && - ./gradlew check && - ./gradlew publishToMavenLocal - - cd ../Task-Tracker-Entities-Impl && - ln -s ../gradle && - ln -s ../gradlew && - ./gradlew check && - ./gradlew publishToMavenLocal - - cd ../Task-Tracker-Usecases && - ln -s ../gradle && - ln -s ../gradlew && - ./gradlew check && - ./gradlew publishToMavenLocal && - - cd ../Task-Tracker-CLI && - ln -s ../gradle && - ln -s ../gradlew && - ./gradlew check && - ./gradlew assembleDist + run: chmod +x build.sh && ./build.sh - uses: actions/upload-artifact@v3 with: name: distribution From 4556bd997d938e47597c884a788e9ad5c2160cb2 Mon Sep 17 00:00:00 2001 From: Gerrit Garbereder Date: Sat, 24 Jun 2023 23:31:24 +0300 Subject: [PATCH 3/6] Update documentation with build instructions --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index c72f067..7ec5312 100644 --- a/README.md +++ b/README.md @@ -1 +1,18 @@ # Task-Tracker-App + +The app is designed to work with the [Task-Tracker-Device](https://github.com/Task-Tracker-Systems/Task-Tracker-Device). + +## Build + +### Local +Run the gradle build in each directory or use the `build.sh` file. + +### Docker +Powershell +```Powershell +docker build -t task-tracker-systems/task-tracker-app:1 . +docker run --rm -v ${PWD}:/dev/mnt task-tracker-systems/task-tracker-app:1 +``` + +### Github +Latest build is available through [Github Actions](https://github.com/Task-Tracker-Systems/Task-Tracker-App/actions) \ No newline at end of file From 0cae2ab706693f7fdda8eb10b348f33ebca182ec Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Tue, 27 Jun 2023 21:31:53 +0200 Subject: [PATCH 4/6] Set execute permission for shell script. --- build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 From 361b963489149c17fd53163b9c130d83d68bd9c0 Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Tue, 27 Jun 2023 22:01:03 +0200 Subject: [PATCH 5/6] Set file modes of executeables accordingly. This way it doesn't need to be set individually. Setting the file mode individually leads to a modified workspace. --- .github/workflows/build.yml | 4 ++-- build.sh | 3 +-- gradlew | 0 3 files changed, 3 insertions(+), 4 deletions(-) mode change 100644 => 100755 gradlew diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 208a411..afb4f2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,8 +31,8 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Build with Gradle - run: chmod +x build.sh && ./build.sh + run: ./build.sh - uses: actions/upload-artifact@v3 with: name: distribution - path: ./Task-Tracker-CLI/build/distributions/*.zip \ No newline at end of file + path: ./Task-Tracker-CLI/build/distributions/*.zip diff --git a/build.sh b/build.sh index b3c5616..168ddb6 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ #!/bin/sh -chmod +x gradlew cd Task-Tracker-Entities if [ ! -d "gradle" ]; then ln -s ../gradle @@ -48,4 +47,4 @@ if [ ! -e "gradlew" ]; then ln -s ../gradlew fi ./gradlew check -./gradlew assembleDist \ No newline at end of file +./gradlew assembleDist diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 From e33eee69892ff7d23a5f3c2b15823cbd74b1f5b5 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Sat, 1 Jul 2023 09:44:36 +0300 Subject: [PATCH 6/6] Update README.md Generic shell name Co-authored-by: David Hebbeker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ec5312..2db541b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The app is designed to work with the [Task-Tracker-Device](https://github.com/Ta Run the gradle build in each directory or use the `build.sh` file. ### Docker -Powershell +Shell ```Powershell docker build -t task-tracker-systems/task-tracker-app:1 . docker run --rm -v ${PWD}:/dev/mnt task-tracker-systems/task-tracker-app:1