From e6ef9428afc3d641249e760f4df3a9ecda9ac429 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 12:13:50 +0530 Subject: [PATCH 01/10] Create maven.yml Build Docker Image --- .github/workflows/maven.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..4136453 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,35 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Build Docker Image + run: docker build -t ohmomar/streamline-solutions:0.0.3.Release . From e0e32cf963db6355c4e66b107c39631d08b4d464 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 12:19:38 +0530 Subject: [PATCH 02/10] Update maven.yml Login Docker --- .github/workflows/maven.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4136453..8cb234f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,3 +33,10 @@ jobs: # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - name: Build Docker Image run: docker build -t ohmomar/streamline-solutions:0.0.3.Release . + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + From e1ce684eac4987c690488c997a49322ce2e5f5e1 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 14:50:37 +0530 Subject: [PATCH 03/10] Update maven.yml clear Disk --- .github/workflows/maven.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8cb234f..c91a1c1 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,15 +28,7 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn clean instakk -DskipTests --file pom.xml - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Build Docker Image - run: docker build -t ohmomar/streamline-solutions:0.0.3.Release . - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} From 9fe210dc3563a5dca12016b11176ada9b15aeec5 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 14:54:18 +0530 Subject: [PATCH 04/10] Update maven.yml --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c91a1c1..7206fd3 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,7 +28,7 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn clean instakk -DskipTests --file pom.xml + run: mvn clean install -DskipTests --file pom.xml From 5846a66f739b5d5c8654743ded142e938ca0abe8 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 16:03:52 +0530 Subject: [PATCH 05/10] Update maven.yml Push docker image --- .github/workflows/maven.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 7206fd3..db523f6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,6 +29,15 @@ jobs: cache: maven - name: Build with Maven run: mvn clean install -DskipTests --file pom.xml + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push Docker Image + run: docker push ohmomar/solutions:0.0.4.Release From 1beca26caa46a486381d4e8aaa5d9ad9e0eaaff9 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 16:05:57 +0530 Subject: [PATCH 06/10] Update maven.yml --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index db523f6..dc140e2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -37,7 +37,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Push Docker Image - run: docker push ohmomar/solutions:0.0.4.Release + run: docker push ohmomar/streamline-solutions:0.0.4.Release From a7ae2891db2374e71f32eb429ad642c21a7920e4 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 16:10:24 +0530 Subject: [PATCH 07/10] Update maven.yml create docker image --- .github/workflows/maven.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index dc140e2..4730d72 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,6 +29,9 @@ jobs: cache: maven - name: Build with Maven run: mvn clean install -DskipTests --file pom.xml + + - name: Build Docker Image + run: docker build -t ohmomar/streamline-solutions:0.0.4.Release . - name: Login to Docker Hub uses: docker/login-action@v1 @@ -36,8 +39,4 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Push Docker Image - run: docker push ohmomar/streamline-solutions:0.0.4.Release - - From 7f7e30b1f9708ecb78200e4d24947842e3425eee Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 18:01:54 +0530 Subject: [PATCH 08/10] Create Dockerfile --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..812b7a9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM eclipse-temurin:17-jdk-jammy + +WORKDIR /app +COPY .mvn/ .mvn +COPY mvnw pom.xml ./ +RUN ./mvnw dependency:resolve + +COPY src ./src + +CMD ["./mvnw","spring-boot:run"] From 961e6b4be983d4eae3d4d337780a520638ba2dd1 Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 18:05:35 +0530 Subject: [PATCH 09/10] Update maven.yml Push Docker Image --- .github/workflows/maven.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4730d72..c694c1a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -38,5 +38,7 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - + + - name: Push Docker Image + run: docker push ohmomar/streamline-solutions:0.0.4.Release From a69675fa6b00d0aa45eebc2497fe794e0352062a Mon Sep 17 00:00:00 2001 From: ohm Date: Mon, 28 Aug 2023 18:10:25 +0530 Subject: [PATCH 10/10] Update maven.yml Deploy docker --- .github/workflows/maven.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c694c1a..9c29fa9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -41,4 +41,6 @@ jobs: - name: Push Docker Image run: docker push ohmomar/streamline-solutions:0.0.4.Release - + + - name: Deploy to Prod Environment + run: docker run -p 5000:5000 ohmomar/streamline-solutions:0.0.4.Release