From c4219ec5bfe42a39dc98042b9b0c94e47c194053 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 11:53:58 +0530 Subject: [PATCH 01/59] test integration --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc93c30f..9f22e667 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -##### +######## - JDK 11 - Maven 3 - MySQL 8 From 684653bc231b1353a9aec9eda62c4d807b08165b Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 30 May 2024 12:01:38 +0530 Subject: [PATCH 02/59] Create main.yml --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 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 00000000..eb57e891 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,9 @@ +name: Hprofile Actions +on: workflow_dispatch +jobs: + Testing: + runs-on: ubuntu-latest + steps: + - name: Testing workflow + run: echo "Workflow works!" + From a41e19c47a3337abbf96d191084d52ebbe25d0a6 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 12:29:55 +0530 Subject: [PATCH 03/59] test --- .github/workflows/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb57e891..49338cc0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,11 @@ jobs: Testing: runs-on: ubuntu-latest steps: - - name: Testing workflow - run: echo "Workflow works!" + - name: code checkout + uses: actions/checkout@v4 + + - name: Maven test + run: mvn test + - name: Checkstyle + run: mvn checkstyle:checkstyle From 36d1b8d6aa359d2825b779572ae1878d066b597e Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 13:03:56 +0530 Subject: [PATCH 04/59] sonar-scanner --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 49338cc0..50c6adc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,3 +12,28 @@ jobs: - name: Checkstyle run: mvn checkstyle:checkstyle + + - name: Set Java 11 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' # See 'Supported distributions' for available options + java-version: '21' + + - name: Setup SonarQube + uses: warchant/setup-sonar-scanner@v7 + + # Run sonar-scanner + - name: SonarQube Scan + run: sonar-scanner + -Dsonar.host.url=${{ secrets.SONAR_URL }} + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.sources=src/ + -Dsonar.junit.reportsPath=target/surefire-report/ + -Dsonar.jacoco.reportsPath=target/jacoco.exec + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/ + + + From 1976fb85024bc38ba74117d6b85cafce51ecb674 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 13:14:30 +0530 Subject: [PATCH 05/59] sonar-scanner-01 --- .github/workflows/main.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50c6adc6..02bb3803 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,21 +19,21 @@ jobs: distribution: 'temurin' # See 'Supported distributions' for available options java-version: '21' - - name: Setup SonarQube - uses: warchant/setup-sonar-scanner@v7 + - name: Setup SonarQube + uses: warchant/setup-sonar-scanner@v7 # Run sonar-scanner - - name: SonarQube Scan - run: sonar-scanner - -Dsonar.host.url=${{ secrets.SONAR_URL }} - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} - -Dsonar.sources=src/ - -Dsonar.junit.reportsPath=target/surefire-report/ - -Dsonar.jacoco.reportsPath=target/jacoco.exec - -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/ + - name: SonarQube Scan + run: sonar-scanner + -Dsonar.host.url=${{ secrets.SONAR_URL }} + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.sources=src/ + -Dsonar.junit.reportsPath=target/surefire-report/ + -Dsonar.jacoco.reportsPath=target/jacoco.exec + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/ From 38978006346e84bee24fba0e6c7744e2d85c1c46 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 13:16:23 +0530 Subject: [PATCH 06/59] sonar-scanner-02 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 02bb3803..808b3c76 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: - name: Set Java 11 uses: actions/setup-java@v4 with: - distribution: 'temurin' # See 'Supported distributions' for available options + distribution: 'temurin' java-version: '21' - name: Setup SonarQube From 99058d2eb6940ab177b002aac3cdd31722566d40 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 13:20:29 +0530 Subject: [PATCH 07/59] sonar-scanner-03 --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 808b3c76..8876dbab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,10 @@ jobs: run: mvn checkstyle:checkstyle - name: Set Java 11 - uses: actions/setup-java@v4 + uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: '21' + distribution: 'temurin' + java-version: '11' - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 From febe394ea1f55a985e1e6423e0271652e7cf361a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 14:16:56 +0530 Subject: [PATCH 08/59] sonar-scanner-04 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8876dbab..e7f4bc1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,11 +13,11 @@ jobs: - name: Checkstyle run: mvn checkstyle:checkstyle - - name: Set Java 11 + - name: Set Java 17 uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 From f45feae250ef0609b171d3741226fd1ad8910e2e Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 14:47:37 +0530 Subject: [PATCH 09/59] sonar-scanner-05 --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7f4bc1a..cd8320ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,7 @@ jobs: -Dsonar.jacoco.reportsPath=target/jacoco.exec -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/ + -X From 80992868d63a3120ab42d246b1af77239d51028a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 15:04:05 +0530 Subject: [PATCH 10/59] sonar-scanner-06 --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cd8320ad..6d40dd3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,11 +13,11 @@ jobs: - name: Checkstyle run: mvn checkstyle:checkstyle - - name: Set Java 17 - uses: actions/setup-java@v3 + - name: Set Java 11 + uses: actions/setup-java@v2 with: - distribution: 'temurin' - java-version: '17' + distribution: 'adopt' + java-version: '11' - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 From d41f96030bf6e24d7071f071f90052f41e8ae491 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 15:14:05 +0530 Subject: [PATCH 11/59] sonar-scanner-07 --- .github/workflows/main.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d40dd3d..d8e41782 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,17 +24,16 @@ jobs: # Run sonar-scanner - name: SonarQube Scan - run: sonar-scanner - -Dsonar.host.url=${{ secrets.SONAR_URL }} - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} - -Dsonar.sources=src/ - -Dsonar.junit.reportsPath=target/surefire-report/ - -Dsonar.jacoco.reportsPath=target/jacoco.exec - -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + run: sonar-scanner \ + -Dsonar.host.url=${{ secrets.SONAR_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} \ + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} \ + -Dsonar.sources=src/ \ + -Dsonar.junit.reportsPath=target/surefire-report/ \ + -Dsonar.jacoco.reportsPath=target/jacoco.exec \ + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml \ -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/ - -X From 51bbb4d1ddf5132189dc57dafde461f6e84655f6 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 15:18:52 +0530 Subject: [PATCH 12/59] sonan-scanner --- .github/workflows/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8e41782..f3a69de3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,16 +24,16 @@ jobs: # Run sonar-scanner - name: SonarQube Scan - run: sonar-scanner \ - -Dsonar.host.url=${{ secrets.SONAR_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} \ - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} \ - -Dsonar.sources=src/ \ - -Dsonar.junit.reportsPath=target/surefire-report/ \ - -Dsonar.jacoco.reportsPath=target/jacoco.exec \ - -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml \ - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/ + run: sonar-scanner + -Dsonar.host.url=${{ secrets.SONAR_URL }} + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.sources=src/ + -Dsonar.junit.reportsPath=target/surefire-report/ + -Dsonar.jacoco.reportsPath=target/jacoco.exec + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account From 068562e163ecbadd731a25bff7e8c2ec8db42086 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 15:48:23 +0530 Subject: [PATCH 13/59] sonar-scanner-08 --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3a69de3..2670aecb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,16 @@ jobs: -Dsonar.jacoco.reportsPath=target/jacoco.exec -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml -Dsonar.java.binaries=target/test-classes/com/visualpathit/account + + # Check the Quality Gate status. + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + # Force to fail step after specific time. + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL From 92b4f328183a0f8ddc9300a12caf178d464c2093 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 17:33:56 +0530 Subject: [PATCH 14/59] BUILD_AND_PUBLISH --- .github/workflows/main.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2670aecb..dff1e47e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,7 @@ name: Hprofile Actions -on: workflow_dispatch +on: workflow_dispatch # [push, workflow_dispatch] +env: + AWS_REGION: us-east-1 jobs: Testing: runs-on: ubuntu-latest @@ -44,6 +46,33 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL + + BUILD_AND_PUBLISH: + needs: Testing + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + + - name: Update application.properties file + run: | + sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties + sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties + sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties + + + - name: upload image to ECR + uses: appleboy/docker-ecr-action@master + with: + access_key: ${{ secrets.aws_access_key_id }} + secret_key: ${{ secrets.aws_secret_access_key }} + registry: ${{ secrets.registry }} + repo: actapp + region: latest,${{ github.run_number }} + region: ${{ env.AWS_REGION }} + daemon_off: false + dockerfile: ./Dockerfile + context: ./ From e27cd9a52ab4ffade99fb988f6ea7a44e551ef00 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 11:19:24 +0530 Subject: [PATCH 15/59] BUILD AND PUSH JOB --- .github/workflows/main.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dff1e47e..6b598511 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,19 +54,18 @@ jobs: - name: code checkout uses: actions/checkout@v4 - - name: Update application.properties file - run: | - sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties - sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties - sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties - +# - name: Update application.properties file +# run: | +# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties +# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties +# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties - name: upload image to ECR uses: appleboy/docker-ecr-action@master with: - access_key: ${{ secrets.aws_access_key_id }} - secret_key: ${{ secrets.aws_secret_access_key }} - registry: ${{ secrets.registry }} + access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + registry: ${{ secrets.REGISTRY }} repo: actapp region: latest,${{ github.run_number }} region: ${{ env.AWS_REGION }} From 86bb64d747a4309f00dfa8e7a5caf06785898374 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 11:21:36 +0530 Subject: [PATCH 16/59] BUILD AND PUSH - 01 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b598511..9621a337 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,8 +67,8 @@ jobs: secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} registry: ${{ secrets.REGISTRY }} repo: actapp - region: latest,${{ github.run_number }} region: ${{ env.AWS_REGION }} + tags: latest,${{ github.run_number }} daemon_off: false dockerfile: ./Dockerfile context: ./ From e06138ecfc12e132dc136d5f83b6aedab503bd81 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 11:26:10 +0530 Subject: [PATCH 17/59] BUILD AND PUSH - 02 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9621a337..4f138a08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} registry: ${{ secrets.REGISTRY }} - repo: actapp + repo: docker region: ${{ env.AWS_REGION }} tags: latest,${{ github.run_number }} daemon_off: false From 5a1df2d64c8a9620fd1dfb0d2b4d483bfef06f44 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 11:31:51 +0530 Subject: [PATCH 18/59] BUILD AND PUSH - 03 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f138a08..44355311 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: registry: ${{ secrets.REGISTRY }} repo: docker region: ${{ env.AWS_REGION }} - tags: latest,${{ github.run_number }} + tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false dockerfile: ./Dockerfile context: ./ From 087034c8c6ee0d5bfcbf13cb9aca96f4da9a2d34 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 12:14:48 +0530 Subject: [PATCH 19/59] Deploy into eks cluster --- .github/workflows/main.yml | 14 ++++++++++++++ java.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 java.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44355311..493e94f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,5 +73,19 @@ jobs: dockerfile: ./Dockerfile context: ./ + DEPLOY: + needs: BUILD_AND_PUBLISH + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + + - name: update kube config + run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster + + - name: Deploy to EKS cluster + run: | + + kubectl apply -f java.yaml diff --git a/java.yaml b/java.yaml new file mode 100644 index 00000000..404bb3df --- /dev/null +++ b/java.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: java-deployment +spec: + selector: + matchLabels: + app.kubernetes.io/name: java-app + replicas: 1 # tells deployment to run 2 pods matching the template + template: + metadata: + labels: + app.kubernetes.io/name: java-app + spec: + containers: + - name: java + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:17 + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: java-service +spec: + ports: + - port: 8080 + targetPort: 80 + type: ClusterIP + selector: + app.kubernetes.io/name: java-app \ No newline at end of file From 9dd7d4f86091ce077dbce8650ea1a5c74fb7ce8a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:12:33 +0530 Subject: [PATCH 20/59] Build and push to ecr --- .github/workflows/main.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 493e94f6..44355311 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,19 +73,5 @@ jobs: dockerfile: ./Dockerfile context: ./ - DEPLOY: - needs: BUILD_AND_PUBLISH - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - - - name: update kube config - run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster - - - name: Deploy to EKS cluster - run: | - - kubectl apply -f java.yaml From 12836333cc21a93c468a0e5d20eb2fc627641745 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:28:01 +0530 Subject: [PATCH 21/59] build, push and deployment --- .github/workflows/main.yml | 59 +++++++++----------------------------- 1 file changed, 14 insertions(+), 45 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44355311..e1c179de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,52 +3,8 @@ on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 jobs: - Testing: - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - - - name: Maven test - run: mvn test - - - name: Checkstyle - run: mvn checkstyle:checkstyle - - - name: Set Java 11 - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '11' - - - name: Setup SonarQube - uses: warchant/setup-sonar-scanner@v7 - - # Run sonar-scanner - - name: SonarQube Scan - run: sonar-scanner - -Dsonar.host.url=${{ secrets.SONAR_URL }} - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} - -Dsonar.sources=src/ - -Dsonar.junit.reportsPath=target/surefire-report/ - -Dsonar.jacoco.reportsPath=target/jacoco.exec - -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account - - # Check the Quality Gate status. - - name: SonarQube Quality Gate check - id: sonarqube-quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@master - # Force to fail step after specific time. - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL - BUILD_AND_PUBLISH: - needs: Testing + #needs: Testing runs-on: ubuntu-latest steps: - name: code checkout @@ -73,5 +29,18 @@ jobs: dockerfile: ./Dockerfile context: ./ + DEPLOY: + needs: BUILD_AND_PUBLISH + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + + - name: update kube config + run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster + + - name: Deploy to EKS cluster + run: | + kubectl apply -f java.yaml From 8340ce7d7849c2a2a45db86438cbf44a9578484a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:33:04 +0530 Subject: [PATCH 22/59] deployment --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1c179de..6b30cc6e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,9 @@ jobs: steps: - name: code checkout uses: actions/checkout@v4 + with: + access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: update kube config run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster From 9e21286f0ecc91cb82ffb4484420403283b0bcfa Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:38:03 +0530 Subject: [PATCH 23/59] deployment --- .github/workflows/main.yml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b30cc6e..8e77f84c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,33 +2,7 @@ name: Hprofile Actions on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 -jobs: - BUILD_AND_PUBLISH: - #needs: Testing - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - -# - name: Update application.properties file -# run: | -# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties -# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties -# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties - - - name: upload image to ECR - uses: appleboy/docker-ecr-action@master - with: - access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - registry: ${{ secrets.REGISTRY }} - repo: docker - region: ${{ env.AWS_REGION }} - tags: ${{ github.run_number }} #latest,${{ github.run_number }} - daemon_off: false - dockerfile: ./Dockerfile - context: ./ - +jobs: DEPLOY: needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest @@ -38,6 +12,7 @@ jobs: with: access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + region: ${{ env.AWS_REGION }} - name: update kube config run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster From 558437b70c9fbd4a7b00b56c5fbc36202a4481ce Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:39:09 +0530 Subject: [PATCH 24/59] deployment - 01 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e77f84c..810ecb83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ env: AWS_REGION: us-east-1 jobs: DEPLOY: - needs: BUILD_AND_PUBLISH + # needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest steps: - name: code checkout From b7d1720e74f3be3c218b4168931d276b193b647d Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:46:14 +0530 Subject: [PATCH 25/59] deployment - 02 --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 810ecb83..4e19c752 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,13 @@ jobs: steps: - name: code checkout uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 with: - access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - region: ${{ env.AWS_REGION }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 - name: update kube config run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster From a1bf6ddf7f5367179052b34f60b04dd4b1b4abcc Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 15:29:02 +0530 Subject: [PATCH 26/59] eks and bash.sh --- .github/workflows/main.yml | 72 ++++++++++++++++++- ...nx-App1-Deployment-and-NodePortService.yml | 40 +++++++++++ EKS/01-ingressclass-resource.yaml | 13 ++++ EKS/02-ALB-Ingress-Basic.yml | 38 ++++++++++ bash.sh | 32 +++++++++ 5 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 EKS/01-Nginx-App1-Deployment-and-NodePortService.yml create mode 100644 EKS/01-ingressclass-resource.yaml create mode 100644 EKS/02-ALB-Ingress-Basic.yml create mode 100644 bash.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e19c752..266e031e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,13 +3,83 @@ on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 jobs: + Testing: + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + + - name: Maven test + run: mvn test + + - name: Checkstyle + run: mvn checkstyle:checkstyle + + - name: Set Java 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Setup SonarQube + uses: warchant/setup-sonar-scanner@v7 + + # Run sonar-scanner + - name: SonarQube Scan + run: sonar-scanner + -Dsonar.host.url=${{ secrets.SONAR_URL }} + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.sources=src/ + -Dsonar.junit.reportsPath=target/surefire-report/ + -Dsonar.jacoco.reportsPath=target/jacoco.exec + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account + + # Check the Quality Gate status. + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + # Force to fail step after specific time. + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL + + BUILD_AND_PUBLISH: + #needs: Testing + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + +# - name: Update application.properties file +# run: | +# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties +# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties +# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties + + - name: upload image to ECR + uses: appleboy/docker-ecr-action@master + with: + access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + registry: ${{ secrets.REGISTRY }} + repo: docker + region: ${{ env.AWS_REGION }} + tags: ${{ github.run_number }} #latest,${{ github.run_number }} + daemon_off: false + dockerfile: ./Dockerfile + context: ./ + DEPLOY: # needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest steps: - name: code checkout uses: actions/checkout@v4 - + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/EKS/01-Nginx-App1-Deployment-and-NodePortService.yml b/EKS/01-Nginx-App1-Deployment-and-NodePortService.yml new file mode 100644 index 00000000..5a9b6d94 --- /dev/null +++ b/EKS/01-Nginx-App1-Deployment-and-NodePortService.yml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app1-nginx-deployment + labels: + app: app1-nginx +spec: + replicas: 1 + selector: + matchLabels: + app: app1-nginx + template: + metadata: + labels: + app: app1-nginx + spec: + containers: + - name: app1-nginx + image: stacksimplify/kube-nginxapp1:1.0.0 + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: app1-nginx-nodeport-service + labels: + app: app1-nginx + annotations: +#Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer +# alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html +spec: + type: NodePort + selector: + app: app1-nginx + ports: + - port: 80 + targetPort: 80 + + \ No newline at end of file diff --git a/EKS/01-ingressclass-resource.yaml b/EKS/01-ingressclass-resource.yaml new file mode 100644 index 00000000..8196bef5 --- /dev/null +++ b/EKS/01-ingressclass-resource.yaml @@ -0,0 +1,13 @@ +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: my-aws-ingress-class + annotations: + ingressclass.kubernetes.io/is-default-class: "true" +spec: + controller: ingress.k8s.aws/alb + +## Additional Note +# 1. You can mark a particular IngressClass as the default for your cluster. +# 2. Setting the ingressclass.kubernetes.io/is-default-class annotation to true on an IngressClass resource will ensure that new Ingresses without an spec.ingressClassName field specified will be assigned this default IngressClass. +# 3. Reference: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/guide/ingress/ingress_class/ \ No newline at end of file diff --git a/EKS/02-ALB-Ingress-Basic.yml b/EKS/02-ALB-Ingress-Basic.yml new file mode 100644 index 00000000..d2759d82 --- /dev/null +++ b/EKS/02-ALB-Ingress-Basic.yml @@ -0,0 +1,38 @@ +# Annotations Reference: https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/annotations/ +# Annotations Reference: https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/annotations/ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-nginxapp1 + labels: + app: app1-nginx + annotations: + # Load Balancer Name + alb.ingress.kubernetes.io/load-balancer-name: app1ingressrules + #kubernetes.io/ingress.class: "alb" (OLD INGRESS CLASS NOTATION - STILL WORKS BUT RECOMMENDED TO USE IngressClass Resource) + # Ingress Core Settings + alb.ingress.kubernetes.io/scheme: internet-facing + # Health Check Settings + alb.ingress.kubernetes.io/healthcheck-protocol: HTTP + alb.ingress.kubernetes.io/healthcheck-port: traffic-port + alb.ingress.kubernetes.io/healthcheck-path: /app1/index.html + alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15' + alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5' + alb.ingress.kubernetes.io/success-codes: '200' + alb.ingress.kubernetes.io/healthy-threshold-count: '2' + alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' +spec: + ingressClassName: my-aws-ingress-class # Ingress Class + rules: + - http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: app1-nginx-nodeport-service + port: + number: 80 + +# 1. If "spec.ingressClassName: my-aws-ingress-class" not specified, will reference default ingress class on this kubernetes cluster +# 2. Default Ingress class is nothing but for which ingress class we have the annotation `ingressclass.kubernetes.io/is-default-class: "true"` diff --git a/bash.sh b/bash.sh new file mode 100644 index 00000000..1e98a189 --- /dev/null +++ b/bash.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +eksctl create iamserviceaccount \ + --cluster=demo-cluster \ + --namespace=kube-system \ + --name=aws-load-balancer-controller \ + --region=us-east-1 \ + --attach-role-arn arn:aws:iam::637423293208:role/aws-service-controller-eks-role \ + --approve + +# eksctl get iamserviceaccount --cluster demo-cluster + +helm repo add eks https://aws.github.io/eks-charts + +helm repo update eks + +helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ + -n kube-system \ + --set clusterName=demo-cluster \ + --set serviceAccount.create=false \ + --set serviceAccount.name=aws-load-balancer-controller \ + --set image.repository=602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-load-balancer-controller \ + --set image.tag=v2.7.1 \ + --set region=us-east-1 \ + --set vpcId=vpc-07d3c084b26a40ddd + + +# Deploy EBS CSI Driver +kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" + +# Verify ebs-csi pods running +kubectl get pods -n kube-system \ No newline at end of file From 5f1c287db7655698fa81f3c4d4f45bfc70fa91f0 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 15:32:52 +0530 Subject: [PATCH 27/59] bash and eks --- .github/workflows/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 266e031e..36413926 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,7 +72,7 @@ jobs: daemon_off: false dockerfile: ./Dockerfile context: ./ - + DEPLOY: # needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest @@ -90,8 +90,15 @@ jobs: - name: update kube config run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster - - name: Deploy to EKS cluster + - name: Run bash.sh run: | + chmod +x ./bash.sh + ./bash.sh + - name: Deploy to EKS cluster + run: | + kubectl apply -f java.yaml + kubectl apply -f EKS/ + From f2949c339921a41bf428aa007e9d24cfe5321582 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 15:37:57 +0530 Subject: [PATCH 28/59] deployment --- .github/workflows/main.yml | 72 -------------------------------------- 1 file changed, 72 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36413926..34c859ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,76 +3,6 @@ on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 jobs: - Testing: - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - - - name: Maven test - run: mvn test - - - name: Checkstyle - run: mvn checkstyle:checkstyle - - - name: Set Java 11 - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '11' - - - name: Setup SonarQube - uses: warchant/setup-sonar-scanner@v7 - - # Run sonar-scanner - - name: SonarQube Scan - run: sonar-scanner - -Dsonar.host.url=${{ secrets.SONAR_URL }} - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} - -Dsonar.sources=src/ - -Dsonar.junit.reportsPath=target/surefire-report/ - -Dsonar.jacoco.reportsPath=target/jacoco.exec - -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account - - # Check the Quality Gate status. - - name: SonarQube Quality Gate check - id: sonarqube-quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@master - # Force to fail step after specific time. - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL - - BUILD_AND_PUBLISH: - #needs: Testing - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - -# - name: Update application.properties file -# run: | -# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties -# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties -# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties - - - name: upload image to ECR - uses: appleboy/docker-ecr-action@master - with: - access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - registry: ${{ secrets.REGISTRY }} - repo: docker - region: ${{ env.AWS_REGION }} - tags: ${{ github.run_number }} #latest,${{ github.run_number }} - daemon_off: false - dockerfile: ./Dockerfile - context: ./ - DEPLOY: # needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest @@ -97,8 +27,6 @@ jobs: - name: Deploy to EKS cluster run: | - - kubectl apply -f java.yaml kubectl apply -f EKS/ From 235cc9372eebc14f8a92a7db9b8b550cebcb136d Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 15:48:18 +0530 Subject: [PATCH 29/59] bash update --- bash.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash.sh b/bash.sh index 1e98a189..aaae6a9b 100644 --- a/bash.sh +++ b/bash.sh @@ -1,5 +1,7 @@ #!/bin/bash +aws eks update-kubeconfig --region us-east-1 --name demo-cluster + eksctl create iamserviceaccount \ --cluster=demo-cluster \ --namespace=kube-system \ From 66a052df952957a02b273737f24ac1ff59740eb8 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 15:51:11 +0530 Subject: [PATCH 30/59] bash update -01 --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34c859ed..9e25f6cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,12 @@ jobs: - name: update kube config run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster + + - name: Install eksctl + run: | + curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp + sudo mv /tmp/eksctl /usr/local/bin + eksctl version - name: Run bash.sh run: | From 6d7ce0a5e0dcf171b02eb2151902afd8a2e4d728 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 16:27:31 +0530 Subject: [PATCH 31/59] update --- .github/workflows/main.yml | 4 +++- bash.sh | 33 ++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e25f6cb..7a5b04e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,5 +34,7 @@ jobs: - name: Deploy to EKS cluster run: | - kubectl apply -f EKS/ + #kubectl apply -f EKS/ + + kubectl delete -f EKS/ diff --git a/bash.sh b/bash.sh index aaae6a9b..f16397a8 100644 --- a/bash.sh +++ b/bash.sh @@ -1,7 +1,5 @@ #!/bin/bash -aws eks update-kubeconfig --region us-east-1 --name demo-cluster - eksctl create iamserviceaccount \ --cluster=demo-cluster \ --namespace=kube-system \ @@ -12,23 +10,28 @@ eksctl create iamserviceaccount \ # eksctl get iamserviceaccount --cluster demo-cluster -helm repo add eks https://aws.github.io/eks-charts +#helm repo add eks https://aws.github.io/eks-charts + +#helm repo update eks -helm repo update eks +helm repo remove eks -helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ - -n kube-system \ - --set clusterName=demo-cluster \ - --set serviceAccount.create=false \ - --set serviceAccount.name=aws-load-balancer-controller \ - --set image.repository=602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-load-balancer-controller \ - --set image.tag=v2.7.1 \ - --set region=us-east-1 \ - --set vpcId=vpc-07d3c084b26a40ddd +#helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ +# -n kube-system \ +# --set clusterName=demo-cluster \ +# --set serviceAccount.create=false \ +# --set serviceAccount.name=aws-load-balancer-controller \ +# --set image.repository=602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-load-balancer-controller \ +# --set image.tag=v2.7.1 \ +# --set region=us-east-1 \ +# --set vpcId=vpc-07d3c084b26a40ddd +helm unstall aws-load-balancer-controller # Deploy EBS CSI Driver -kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" +# kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" + +kubectl delete -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" # Verify ebs-csi pods running -kubectl get pods -n kube-system \ No newline at end of file +#kubectl get pods -n kube-system \ No newline at end of file From 72fe50e62ea5f7b99a7a357da5104a3971638f64 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 16:43:40 +0530 Subject: [PATCH 32/59] update - 01 --- .github/workflows/main.yml | 4 ++-- bash.sh | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a5b04e6..4e0c8ac8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: - name: Deploy to EKS cluster run: | - #kubectl apply -f EKS/ + kubectl apply -f EKS/ - kubectl delete -f EKS/ + #kubectl delete -f EKS/ diff --git a/bash.sh b/bash.sh index f16397a8..ea997d2a 100644 --- a/bash.sh +++ b/bash.sh @@ -10,28 +10,28 @@ eksctl create iamserviceaccount \ # eksctl get iamserviceaccount --cluster demo-cluster -#helm repo add eks https://aws.github.io/eks-charts +helm repo add eks https://aws.github.io/eks-charts -#helm repo update eks +helm repo update eks -helm repo remove eks +#helm repo remove eks -#helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ -# -n kube-system \ -# --set clusterName=demo-cluster \ -# --set serviceAccount.create=false \ -# --set serviceAccount.name=aws-load-balancer-controller \ -# --set image.repository=602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-load-balancer-controller \ -# --set image.tag=v2.7.1 \ -# --set region=us-east-1 \ -# --set vpcId=vpc-07d3c084b26a40ddd +helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ + -n kube-system \ + --set clusterName=demo-cluster \ + --set serviceAccount.create=false \ + --set serviceAccount.name=aws-load-balancer-controller \ + --set image.repository=602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-load-balancer-controller \ + --set image.tag=v2.7.1 \ + --set region=us-east-1 \ + --set vpcId=vpc-07d3c084b26a40ddd helm unstall aws-load-balancer-controller # Deploy EBS CSI Driver -# kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" +kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" -kubectl delete -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" +#kubectl delete -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" # Verify ebs-csi pods running -#kubectl get pods -n kube-system \ No newline at end of file +kubectl get pods -n kube-system \ No newline at end of file From c598c66a0e2af466d3279ab7906c2ef61395ab4a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 16:46:11 +0530 Subject: [PATCH 33/59] update - 02 --- bash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.sh b/bash.sh index ea997d2a..86159083 100644 --- a/bash.sh +++ b/bash.sh @@ -26,7 +26,7 @@ helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ --set region=us-east-1 \ --set vpcId=vpc-07d3c084b26a40ddd -helm unstall aws-load-balancer-controller +#helm unstall aws-load-balancer-controller # Deploy EBS CSI Driver kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" From dc5a77832694117afef9745a41d86e6788205cff Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 18:11:47 +0530 Subject: [PATCH 34/59] Image tag update in yaml file --- .github/workflows/main.yml | 91 +++++++++++++++++++++-------- pipeline-script.sh | 113 +++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 25 deletions(-) create mode 100644 pipeline-script.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e0c8ac8..5f34f21b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,39 +2,80 @@ name: Hprofile Actions on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 -jobs: - DEPLOY: - # needs: BUILD_AND_PUBLISH +jobs: + Testing: runs-on: ubuntu-latest steps: - name: code checkout - uses: actions/checkout@v4 + uses: actions/checkout@v4 + + - name: Maven test + run: mvn test + + - name: Checkstyle + run: mvn checkstyle:checkstyle - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v2 + - name: Set Java 11 + uses: actions/setup-java@v2 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: update kube config - run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster + distribution: 'adopt' + java-version: '11' + + - name: Setup SonarQube + uses: warchant/setup-sonar-scanner@v7 - - name: Install eksctl - run: | - curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp - sudo mv /tmp/eksctl /usr/local/bin - eksctl version + # Run sonar-scanner + - name: SonarQube Scan + run: sonar-scanner + -Dsonar.host.url=${{ secrets.SONAR_URL }} + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.sources=src/ + -Dsonar.junit.reportsPath=target/surefire-report/ + -Dsonar.jacoco.reportsPath=target/jacoco.exec + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account - - name: Run bash.sh - run: | - chmod +x ./bash.sh - ./bash.sh + # Check the Quality Gate status. + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + # Force to fail step after specific time. + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL - - name: Deploy to EKS cluster - run: | + BUILD_AND_PUBLISH: + needs: Testing + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + +# - name: Update application.properties file +# run: | +# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties +# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties +# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties - kubectl apply -f EKS/ + - name: upload image to ECR + uses: appleboy/docker-ecr-action@master + with: + access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + registry: ${{ secrets.REGISTRY }} + repo: docker + region: ${{ env.AWS_REGION }} + tags: ${{ github.run_number }} #latest,${{ github.run_number }} + daemon_off: false + dockerfile: ./Dockerfile + context: ./ + + - name: Update Image tag + run: | + sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml - #kubectl delete -f EKS/ + diff --git a/pipeline-script.sh b/pipeline-script.sh new file mode 100644 index 00000000..74739533 --- /dev/null +++ b/pipeline-script.sh @@ -0,0 +1,113 @@ +name: Hprofile Actions +on: workflow_dispatch # [push, workflow_dispatch] +env: + AWS_REGION: us-east-1 +jobs: + Testing: + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + + - name: Maven test + run: mvn test + + - name: Checkstyle + run: mvn checkstyle:checkstyle + + - name: Set Java 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Setup SonarQube + uses: warchant/setup-sonar-scanner@v7 + + # Run sonar-scanner + - name: SonarQube Scan + run: sonar-scanner + -Dsonar.host.url=${{ secrets.SONAR_URL }} + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.sources=src/ + -Dsonar.junit.reportsPath=target/surefire-report/ + -Dsonar.jacoco.reportsPath=target/jacoco.exec + -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account + + # Check the Quality Gate status. + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + # Force to fail step after specific time. + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL + + BUILD_AND_PUBLISH: + needs: Testing + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + +# - name: Update application.properties file +# run: | +# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties +# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties +# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties + + - name: upload image to ECR + uses: appleboy/docker-ecr-action@master + with: + access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + registry: ${{ secrets.REGISTRY }} + repo: docker + region: ${{ env.AWS_REGION }} + tags: ${{ github.run_number }} #latest,${{ github.run_number }} + daemon_off: false + dockerfile: ./Dockerfile + context: ./ + + - name: Update Image tag + run: | + sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml + + + DEPLOY: + # needs: BUILD_AND_PUBLISH + runs-on: ubuntu-latest + steps: + - name: code checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: update kube config + run: aws eks update-kubeconfig --region us-east-1 --name demo-cluster + + - name: Install eksctl + run: | + curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp + sudo mv /tmp/eksctl /usr/local/bin + eksctl version + + - name: Run bash.sh + run: | + chmod +x ./bash.sh + ./bash.sh + + - name: Deploy to EKS cluster + run: | + + kubectl apply -f EKS/ + From a423cc7cd1460f9d0d324a7daf0409257593a7e2 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 18:54:32 +0530 Subject: [PATCH 35/59] Image update --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f34f21b..2e43517c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,5 +77,13 @@ jobs: run: | sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml + - name: Commit changes + run: | + git config --global user.name 'KNarendra99599' + git config --global user.email kasaragaddanarendra99@gmail.com + git add java.yaml + git commit -m "Update image to ${{ github.run_number }}" + git push + From 2f0198ad7be7578f7ee115e12c70d846c4983dba Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:33:57 +0000 Subject: [PATCH 36/59] Update image to 35 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index 404bb3df..1387cb82 100644 --- a/java.yaml +++ b/java.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: java - image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:17 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:35 ports: - containerPort: 80 --- From 94dca8509d2c1bf35e49d125ef33fb2c416e252e Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 19:07:56 +0530 Subject: [PATCH 37/59] secrets update --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e43517c..9864f2eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,8 +79,8 @@ jobs: - name: Commit changes run: | - git config --global user.name 'KNarendra99599' - git config --global user.email kasaragaddanarendra99@gmail.com + git config --global user.name ${{ secrets.USER_NAME }} + git config --global user.email ${{ secrets.USER_MAIL }} git add java.yaml git commit -m "Update image to ${{ github.run_number }}" git push From bcdf81c33f0daa55017d6a047df899f5e17fedba Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 13:41:43 +0000 Subject: [PATCH 38/59] Update image to 36 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index 1387cb82..d1bb73cb 100644 --- a/java.yaml +++ b/java.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: java - image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:35 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:36 ports: - containerPort: 80 --- From 1038bb78fef8aa4111de82819141f41762a7e726 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 31 May 2024 20:05:49 +0530 Subject: [PATCH 39/59] Pipe line script --- pipeline-script.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pipeline-script.sh b/pipeline-script.sh index 74739533..1f9c1f00 100644 --- a/pipeline-script.sh +++ b/pipeline-script.sh @@ -73,11 +73,18 @@ jobs: dockerfile: ./Dockerfile context: ./ - - name: Update Image tag + - name: Update Image tag in deployment file run: | sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml - + - name: Commit changes + run: | + git config --global user.name ${{ secrets.USER_NAME }} + git config --global user.email ${{ secrets.USER_MAIL }} + git add java.yaml + git commit -m "Update image to ${{ github.run_number }}" + git push + DEPLOY: # needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest From 21d2bbbf02582bbcfab95e169048cdc5020e5553 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 14:44:18 +0530 Subject: [PATCH 40/59] bash --- bash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.sh b/bash.sh index 86159083..6f2cd805 100644 --- a/bash.sh +++ b/bash.sh @@ -1,6 +1,6 @@ #!/bin/bash -eksctl create iamserviceaccount \ +sudo eksctl create iamserviceaccount \ --cluster=demo-cluster \ --namespace=kube-system \ --name=aws-load-balancer-controller \ From 9d6b05c7c6e61edb1104275a39b27b4e6dc3e397 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:00:31 +0530 Subject: [PATCH 41/59] cicd pipeline --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9864f2eb..2aabf9d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,10 @@ name: Hprofile Actions -on: workflow_dispatch # [push, workflow_dispatch] +#on: workflow_dispatch # [push, workflow_dispatch] +on: + push: + branches: + - master + workflow_dispatch: env: AWS_REGION: us-east-1 jobs: From b2a60135a69da1b86c7bab6ba69bf0dd8c946125 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:04:25 +0530 Subject: [PATCH 42/59] Jenkinsfile deleted --- Jenkinsfile | 122 ---------------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 7fecd3c2..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,122 +0,0 @@ -pipeline { - - agent any -/* - tools { - maven "maven3" - - } -*/ - environment { - NEXUS_VERSION = "nexus3" - NEXUS_PROTOCOL = "http" - NEXUS_URL = "172.31.40.209:8081" - NEXUS_REPOSITORY = "vprofile-release" - NEXUS_REPO_ID = "vprofile-release" - NEXUS_CREDENTIAL_ID = "nexuslogin" - ARTVERSION = "${env.BUILD_ID}" - } - - stages{ - - stage('BUILD'){ - steps { - sh 'mvn clean install -DskipTests' - } - post { - success { - echo 'Now Archiving...' - archiveArtifacts artifacts: '**/target/*.war' - } - } - } - - stage('UNIT TEST'){ - steps { - sh 'mvn test' - } - } - - stage('INTEGRATION TEST'){ - steps { - sh 'mvn verify -DskipUnitTests' - } - } - - stage ('CODE ANALYSIS WITH CHECKSTYLE'){ - steps { - sh 'mvn checkstyle:checkstyle' - } - post { - success { - echo 'Generated Analysis Result' - } - } - } - - stage('CODE ANALYSIS with SONARQUBE') { - - environment { - scannerHome = tool 'sonarscanner4' - } - - steps { - withSonarQubeEnv('sonar-pro') { - sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ - -Dsonar.projectName=vprofile-repo \ - -Dsonar.projectVersion=1.0 \ - -Dsonar.sources=src/ \ - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ - -Dsonar.junit.reportsPath=target/surefire-reports/ \ - -Dsonar.jacoco.reportsPath=target/jacoco.exec \ - -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' - } - - timeout(time: 10, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } - - stage("Publish to Nexus Repository Manager") { - steps { - script { - pom = readMavenPom file: "pom.xml"; - filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); - echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" - artifactPath = filesByGlob[0].path; - artifactExists = fileExists artifactPath; - if(artifactExists) { - echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version} ARTVERSION"; - nexusArtifactUploader( - nexusVersion: NEXUS_VERSION, - protocol: NEXUS_PROTOCOL, - nexusUrl: NEXUS_URL, - groupId: pom.groupId, - version: ARTVERSION, - repository: NEXUS_REPOSITORY, - credentialsId: NEXUS_CREDENTIAL_ID, - artifacts: [ - [artifactId: pom.artifactId, - classifier: '', - file: artifactPath, - type: pom.packaging], - [artifactId: pom.artifactId, - classifier: '', - file: "pom.xml", - type: "pom"] - ] - ); - } - else { - error "*** File: ${artifactPath}, could not be found"; - } - } - } - } - - - } - - -} From 8444ac21925e0de3696d24bc2e311801bb854a5e Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:08:53 +0530 Subject: [PATCH 43/59] action deleted --- .github/workflows/main.yml | 89 -------------------------------------- README.md | 2 +- 2 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 9864f2eb..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Hprofile Actions -on: workflow_dispatch # [push, workflow_dispatch] -env: - AWS_REGION: us-east-1 -jobs: - Testing: - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - - - name: Maven test - run: mvn test - - - name: Checkstyle - run: mvn checkstyle:checkstyle - - - name: Set Java 11 - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '11' - - - name: Setup SonarQube - uses: warchant/setup-sonar-scanner@v7 - - # Run sonar-scanner - - name: SonarQube Scan - run: sonar-scanner - -Dsonar.host.url=${{ secrets.SONAR_URL }} - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} - -Dsonar.sources=src/ - -Dsonar.junit.reportsPath=target/surefire-report/ - -Dsonar.jacoco.reportsPath=target/jacoco.exec - -Dsonar.java.checkstyle.reportsPath=target/checkstyle-result.xml - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account - - # Check the Quality Gate status. - - name: SonarQube Quality Gate check - id: sonarqube-quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@master - # Force to fail step after specific time. - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL - - BUILD_AND_PUBLISH: - needs: Testing - runs-on: ubuntu-latest - steps: - - name: code checkout - uses: actions/checkout@v4 - -# - name: Update application.properties file -# run: | -# sed -i "s/^jdbc.username.*$/jdbc.username\=${{ secrets.RDS_USER }}/" src/main/resources/application.properties -# sed -i "s/^jdbc.password.*$/jdbc.password\=${{ secrets.RDS_PASS }}/" src/main/resources/application.properties -# sed -i "s/db01/${{ secrets.RDS_ENDPOINT }}/" src/main/resources/application.properties - - - name: upload image to ECR - uses: appleboy/docker-ecr-action@master - with: - access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - registry: ${{ secrets.REGISTRY }} - repo: docker - region: ${{ env.AWS_REGION }} - tags: ${{ github.run_number }} #latest,${{ github.run_number }} - daemon_off: false - dockerfile: ./Dockerfile - context: ./ - - - name: Update Image tag - run: | - sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml - - - name: Commit changes - run: | - git config --global user.name ${{ secrets.USER_NAME }} - git config --global user.email ${{ secrets.USER_MAIL }} - git add java.yaml - git commit -m "Update image to ${{ github.run_number }}" - git push - - - diff --git a/README.md b/README.md index 9f22e667..6753ceec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -######## +########## - JDK 11 - Maven 3 - MySQL 8 From b0e4a5fb891da4ef17834e2081c02fb530345f52 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:52:39 +0530 Subject: [PATCH 44/59] commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6753ceec..4c171179 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -########## +################################################## - JDK 11 - Maven 3 - MySQL 8 From 4d725e70f6d193a39c49d1e59c7dfb0a34309356 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:11:25 +0530 Subject: [PATCH 45/59] readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c171179..0ce4e5da 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -################################################## + - JDK 11 - Maven 3 - MySQL 8 From 64a4ab46fe1bea6e43b854b91c8defe7f3d31486 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:20:23 +0530 Subject: [PATCH 46/59] readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ce4e5da..9a1b4c91 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites - +####### - JDK 11 - Maven 3 - MySQL 8 From a52fc8828d7dc891b47b91a5147ed7730b501e22 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:03:38 +0530 Subject: [PATCH 47/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a1b4c91..78c8aed0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -####### +# - JDK 11 - Maven 3 - MySQL 8 From 91980f588ca6c7734ce278cb5f71cf26f2b0f45e Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:17:21 +0530 Subject: [PATCH 48/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78c8aed0..dc93c30f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -# +##### - JDK 11 - Maven 3 - MySQL 8 From a5169ccb5b6a37849144f7c0242ede2d654dd3fb Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:24:44 +0530 Subject: [PATCH 49/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc93c30f..9a1b4c91 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -##### +####### - JDK 11 - Maven 3 - MySQL 8 From daed548e34b31f02c4517dd3ac388172253d9f74 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:28:31 +0530 Subject: [PATCH 50/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a1b4c91..613098ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -####### +######### - JDK 11 - Maven 3 - MySQL 8 From 23b186a8c584545b3735620ed1da6830a2aed1f7 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:32:44 +0530 Subject: [PATCH 51/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 613098ff..1dfdfc33 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -######### +########### - JDK 11 - Maven 3 - MySQL 8 From f96d3eaa283eba28975d592a135f74a59ebb09d5 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:35:17 +0530 Subject: [PATCH 52/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1dfdfc33..20b6204d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -########### +############ - JDK 11 - Maven 3 - MySQL 8 From 81b4a62847ecb9f035f4068b0562ca064d0d07e7 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:38:56 +0530 Subject: [PATCH 53/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20b6204d..1dfdfc33 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -############ +########### - JDK 11 - Maven 3 - MySQL 8 From b3c52d51011d659fae6844f02de1d03163de76f4 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:32:43 +0530 Subject: [PATCH 54/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1dfdfc33..6753ceec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -########### +########## - JDK 11 - Maven 3 - MySQL 8 From 211f24cedea210a0cb662042276717a47bea7c92 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:50:10 +0530 Subject: [PATCH 55/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6753ceec..20b6204d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -########## +############ - JDK 11 - Maven 3 - MySQL 8 From 92ae8e84dd261f653c2d68d4a86d64f476daf76a Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:05:45 +0530 Subject: [PATCH 56/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20b6204d..6753ceec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -############ +########## - JDK 11 - Maven 3 - MySQL 8 From 551d694eba570f8011e17362b03467e5c2c1cb3c Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:17:55 +0530 Subject: [PATCH 57/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6753ceec..20b6204d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -########## +############ - JDK 11 - Maven 3 - MySQL 8 From 4922182b0e36b6f2a2a8fbaa4b6b0d7c5764ef21 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:31:25 +0530 Subject: [PATCH 58/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20b6204d..2722fcce 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -############ +############# - JDK 11 - Maven 3 - MySQL 8 From 1ee1987fa2d075e4e75a9233c509f2c4921e40c7 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:20:35 +0530 Subject: [PATCH 59/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2722fcce..1dfdfc33 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -############# +########### - JDK 11 - Maven 3 - MySQL 8