From 0fafbabed9a61472f192491dc22a168e5872f83f Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:20:50 +0100 Subject: [PATCH 01/10] Update ci.yml --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a429a2a98..0b7641ba9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,6 @@ on: jobs: build-java: - runs-on: ubuntu-latest steps: @@ -20,13 +19,13 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: '1.8' - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build + run: ./gradlew build --stacktrace # Added --stacktrace for debugging - name: Build and Push Docker Image uses: mr-smithers-excellent/docker-build-push@v4 @@ -34,5 +33,4 @@ jobs: image: nanajanashia/demo-app registry: docker.io username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - + password: ${{ secrets.DOCKER_PASSWORD }} From 1791c413f32388e07da052ba74cff5158f82ff0b Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:35:53 +0100 Subject: [PATCH 02/10] Update ci.yml --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b7641ba9..b81b92f86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: - java-version: '1.8' + java-version: 1.8 - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -27,10 +27,10 @@ jobs: - name: Build with Gradle run: ./gradlew build --stacktrace # Added --stacktrace for debugging - - name: Build and Push Docker Image - uses: mr-smithers-excellent/docker-build-push@v4 - with: - image: nanajanashia/demo-app - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + # - name: Build and Push Docker Image + # uses: mr-smithers-excellent/docker-build-push@v4 + # with: + # image: destinyobs/demo-app + # registry: docker.io + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} From 7324ff088c6ea25d2173b68d51387f228c614b0a Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:43:10 +0100 Subject: [PATCH 03/10] Update ci.yml --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b81b92f86..b48e8fb5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,10 @@ on: jobs: build-java: - runs-on: ubuntu-latest + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v2 From 824a7faad673a32d8ec425eeb4b8468a0e250d47 Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:53:42 +0100 Subject: [PATCH 04/10] Update ci.yml --- .github/workflows/ci.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b48e8fb5e..7932b20fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,7 @@ on: jobs: build-java: - runs-on: ${{matrix.os}} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -28,12 +25,12 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build --stacktrace # Added --stacktrace for debugging + run: ./gradlew build --stacktrace - # - name: Build and Push Docker Image - # uses: mr-smithers-excellent/docker-build-push@v4 - # with: - # image: destinyobs/demo-app - # registry: docker.io - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push Docker Image + uses: mr-smithers-excellent/docker-build-push@v4 + with: + image: destinyobs/javacicd + registry: docker.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} From 2aaac270aa58926ee139b218333f7e099c13b742 Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:20:38 +0100 Subject: [PATCH 05/10] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7932b20fa..a3827f931 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Build and Push Docker Image uses: mr-smithers-excellent/docker-build-push@v4 with: - image: destinyobs/javacicd + image: destinyobs/cicdjavap registry: docker.io username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} From e209fc1b419b2d416fff5f1ca460b577b064deed Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:26:31 +0100 Subject: [PATCH 06/10] Update ci.yml --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3827f931..eb2e56e59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,9 @@ jobs: - name: Build and Push Docker Image uses: mr-smithers-excellent/docker-build-push@v4 with: - image: destinyobs/cicdjavap + image: destinyobs/javacicd registry: docker.io username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile + context: . From 12dffa1f61257cf05ddb1f2171162b5f6ae1432c Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:00:56 +0100 Subject: [PATCH 07/10] Update build.gradle --- build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 06ee087e2..8cee84508 100644 --- a/build.gradle +++ b/build.gradle @@ -16,5 +16,16 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' compile group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '5.2' - testCompile group: 'junit', name: 'junit', version: '4.12' + testImplementation group: 'junit', name: 'junit', version: '4.12' +} + +jar { + from { ['src/main/java', 'src/main/resources'] } + exclude '**/*.java' + manifest { + attributes 'Main-Class': 'com.example.App' + } + bootJar { + enabled = true + } } From bec47d334ce1abe223fd4d5a2157a4c6fa74ae3b Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:29:08 +0100 Subject: [PATCH 08/10] Update ci.yml --- .github/workflows/ci.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb2e56e59..11fe5e425 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,12 +27,4 @@ jobs: - name: Build with Gradle run: ./gradlew build --stacktrace - - name: Build and Push Docker Image - uses: mr-smithers-excellent/docker-build-push@v4 - with: - image: destinyobs/javacicd - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: Dockerfile - context: . + From 8b7270950d3385a2265f27a56b67ca09f9731403 Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:38:00 +0100 Subject: [PATCH 09/10] Update ci.yml --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11fe5e425..3aaed520d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,5 +26,17 @@ jobs: - name: Build with Gradle run: ./gradlew build --stacktrace + + - name: Build and Push Docker Image + uses: mr-smithers-excellent/docker-build-push@v4 + with: + image: destinyobs/javacicd + registry: docker.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile + context: . + + From 7a75f307ccf01666b345a98bc72b4f117127ed39 Mon Sep 17 00:00:00 2001 From: Destiny Obs <105108419+DestinyObs@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:38:26 +0100 Subject: [PATCH 10/10] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d2b1dc574..a382a2311 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine EXPOSE 8080 -COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/ +#COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/ WORKDIR /usr/app ENTRYPOINT ["java", "-jar", "my-app-1.0-SNAPSHOT.jar"]