From 941f629de0ab8e0815c7b4c9838a02a8f4197ff2 Mon Sep 17 00:00:00 2001 From: Harsh Gaurav <74445745+developergaurav-exe@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:25:57 +0530 Subject: [PATCH 1/3] Dockerfile and change in banner.txt --- Dockerfile | 5 +++++ src/main/resources/banner.txt | 1 + 2 files changed, 6 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..abb8fc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:17.0.2-slim +EXPOSE 80 +ARG JAR=target/spring-petclinic-3.1.0-SNAPSHOT.jar +COPY $JAR /app.jar +ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt index 6225d12..aa0f96c 100644 --- a/src/main/resources/banner.txt +++ b/src/main/resources/banner.txt @@ -12,4 +12,5 @@ ==================================================================/_/_/_/ :: Built with Spring Boot :: ${spring-boot.version} +:: NEW AUTHOR ADDITION = Harsh Gaurav :: From ad2bac6c2eb8959d684c99a7712645458802605d Mon Sep 17 00:00:00 2001 From: Harsh Gaurav <74445745+developergaurav-exe@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:29:48 +0530 Subject: [PATCH 2/3] Create main.yml --- .github/workflows/main.yml | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..97b36b5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,73 @@ +name: Azure Web App Container Deployment + + + +on: + push: + branches: + - CISetupFeature # Change this to your default branch + + + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + + + # - name: Skip TEST Maven + # run: mvn install -Dmaven.test.skip=true + + + + - name: Build with Maven + run: mvn -B package --file pom.xml + + + + - name: Set up Docker + uses: azure/docker-login@v1 + with: + login-server: https://hub.docker.com/ + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + + + # - name: Build and push Docker image + # run: | + # docker build -t harshgaurav/shell-java-app:0.0.1.Release . + # docker push harshgaurav/shell-java-app:0.0.1.Release + + + + - name: Build Docker Image + run: docker build -t harshgaurav/harshgaurav-java-app:0.0.1.Release . + + + + - 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 harshgaurav/harshgaurav-java-app:0.0.1.Release From 1fd9b0831328b5d5fc5764be00dd623b6c6427d9 Mon Sep 17 00:00:00 2001 From: Harsh Gaurav <74445745+developergaurav-exe@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:38:02 +0530 Subject: [PATCH 3/3] banner.txt edit in feature branch --- src/main/resources/banner.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt index aa0f96c..249cfd2 100644 --- a/src/main/resources/banner.txt +++ b/src/main/resources/banner.txt @@ -12,5 +12,5 @@ ==================================================================/_/_/_/ :: Built with Spring Boot :: ${spring-boot.version} -:: NEW AUTHOR ADDITION = Harsh Gaurav :: +:: NEW AUTHOR ADDITION = Harsh Gaurav :: (New change committed in feature branch)