From c4219ec5bfe42a39dc98042b9b0c94e47c194053 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 30 May 2024 11:53:58 +0530 Subject: [PATCH 001/112] 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 002/112] 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 003/112] 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 004/112] 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 005/112] 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 006/112] 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 007/112] 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 008/112] 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 009/112] 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 010/112] 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 011/112] 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 012/112] 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 013/112] 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 014/112] 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 015/112] 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 016/112] 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 017/112] 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 018/112] 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 019/112] 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 020/112] 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 021/112] 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 022/112] 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 023/112] 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 024/112] 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 025/112] 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 026/112] 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 027/112] 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 028/112] 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 029/112] 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 030/112] 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 031/112] 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 032/112] 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 033/112] 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 034/112] 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 035/112] 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 036/112] 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 037/112] 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 038/112] 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 039/112] 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 040/112] 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 041/112] 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 042/112] 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 043/112] 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 f875630a9776d7da231d5264ff50c011493f6837 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:50:56 +0530 Subject: [PATCH 044/112] master --- .github/workflows/main.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2aabf9d1..dd3f019d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,21 @@ name: Hprofile Actions #on: workflow_dispatch # [push, workflow_dispatch] on: - push: - branches: - - master - workflow_dispatch: + pull_request: + types: + - closed # Trigger the workflow when a pull request is closed + env: AWS_REGION: us-east-1 jobs: + + if_merged: + if: github.event.pull_request.merged == true # Check if the pull request was merged + runs-on: ubuntu-latest # Specify the runner + steps: + - run: | + echo The PR was merged # Print a message if the pull request was merged + Testing: runs-on: ubuntu-latest steps: From b0e4a5fb891da4ef17834e2081c02fb530345f52 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:52:39 +0530 Subject: [PATCH 045/112] 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 1f5e4d579dc30e0145e83a2200ac1dffa361d654 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 10:26:40 +0000 Subject: [PATCH 046/112] Update image to 37 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index d1bb73cb..d3313add 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:36 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:37 ports: - containerPort: 80 --- From 775cd6c1825ea4bcd18af60f168d134923e6c4f6 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 15:58:15 +0530 Subject: [PATCH 047/112] main.yaml --- .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 dd3f019d..88230356 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ env: AWS_REGION: us-east-1 jobs: - if_merged: + If_merged: if: github.event.pull_request.merged == true # Check if the pull request was merged runs-on: ubuntu-latest # Specify the runner steps: From b6cbbebbf7b4117f968357fbb9627e3178ab295a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:09:39 +0530 Subject: [PATCH 048/112] main.yaml updated --- .github/workflows/main.yml | 2 ++ pipeline-script.sh | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88230356..678a0855 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,7 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: + needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout @@ -61,6 +62,7 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL BUILD_AND_PUBLISH: + if: false # This condition effectively skips the job needs: Testing runs-on: ubuntu-latest steps: diff --git a/pipeline-script.sh b/pipeline-script.sh index 1f9c1f00..a22aa59d 100644 --- a/pipeline-script.sh +++ b/pipeline-script.sh @@ -1,9 +1,22 @@ name: Hprofile Actions -on: workflow_dispatch # [push, workflow_dispatch] +#on: workflow_dispatch # [push, workflow_dispatch] +on: + pull_request: + types: + - closed # Trigger the workflow when a pull request is closed env: AWS_REGION: us-east-1 jobs: + + If_merged: + if: github.event.pull_request.merged == true # Check if the pull request was merged + runs-on: ubuntu-latest # Specify the runner + steps: + - run: | + echo The PR was merged # Print a message if the pull request was merged + Testing: + needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout @@ -48,6 +61,7 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL BUILD_AND_PUBLISH: + if: false # This condition effectively skips the job needs: Testing runs-on: ubuntu-latest steps: From 4d725e70f6d193a39c49d1e59c7dfb0a34309356 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:11:25 +0530 Subject: [PATCH 049/112] 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 6e302dc1b6218f23ec1d0ceaf9352ee97e610a6f Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:18:48 +0530 Subject: [PATCH 050/112] main.yaml update --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 678a0855..459620b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -100,5 +100,38 @@ jobs: git commit -m "Update image to ${{ github.run_number }}" git push + + 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 1fd955782521d70580d09dd9aa66d929f21249a7 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:19:05 +0530 Subject: [PATCH 051/112] main.yaml updated --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 459620b4..06e95085 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -102,7 +102,8 @@ jobs: DEPLOY: - # needs: BUILD_AND_PUBLISH + if: false # This condition effectively skips the job + needs: BUILD_AND_PUBLISH runs-on: ubuntu-latest steps: - name: code checkout From 64a4ab46fe1bea6e43b854b91c8defe7f3d31486 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Wed, 12 Jun 2024 16:20:23 +0530 Subject: [PATCH 052/112] 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 a4d16239f93cc392bdcbde97a325e6628a3572da Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:29:22 +0530 Subject: [PATCH 053/112] Update main.yml --- .github/workflows/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 06e95085..8d3d27b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,16 @@ name: Hprofile Actions -#on: workflow_dispatch # [push, workflow_dispatch] -on: - pull_request: - types: - - closed # Trigger the workflow when a pull request is closed +on: workflow_dispatch # [push, workflow_dispatch] +#on: +# pull_request: +# types: +# - closed # Trigger the workflow when a pull request is closed env: AWS_REGION: us-east-1 jobs: If_merged: + if: false # This condition effectively skips the job if: github.event.pull_request.merged == true # Check if the pull request was merged runs-on: ubuntu-latest # Specify the runner steps: From ae62c4e7abbc8c6e0e969b61541101ecd1f8530b Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:31:27 +0530 Subject: [PATCH 054/112] Update main.yml --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d3d27b1..b0728a68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,13 +9,13 @@ env: AWS_REGION: us-east-1 jobs: - If_merged: - if: false # This condition effectively skips the job - if: github.event.pull_request.merged == true # Check if the pull request was merged - runs-on: ubuntu-latest # Specify the runner - steps: - - run: | - echo The PR was merged # Print a message if the pull request was merged +# If_merged: +# if: false # This condition effectively skips the job +# if: github.event.pull_request.merged == true # Check if the pull request was merged +# runs-on: ubuntu-latest # Specify the runner +# steps: +# - run: | +# echo The PR was merged # Print a message if the pull request was merged Testing: needs: If_merged From 487a591fe1787c15db827171984273a784a57710 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:32:46 +0530 Subject: [PATCH 055/112] Update main.yml --- .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 b0728a68..f7110dd8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: # echo The PR was merged # Print a message if the pull request was merged Testing: - needs: If_merged +# needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout From a9fb4a557e5704204c496f5da07111ecf5615be4 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 18 Jun 2024 10:16:30 +0000 Subject: [PATCH 056/112] ingress --- ...ss-Basic.yml => 02-ALB-Ingress-Basic.ymlx} | 0 EKS/03-ALB-Ingress-Basic.yml | 48 +++++++++++++++++++ EKS/ingress.yaml | 21 ++++++++ 3 files changed, 69 insertions(+) rename EKS/{02-ALB-Ingress-Basic.yml => 02-ALB-Ingress-Basic.ymlx} (100%) create mode 100644 EKS/03-ALB-Ingress-Basic.yml create mode 100644 EKS/ingress.yaml diff --git a/EKS/02-ALB-Ingress-Basic.yml b/EKS/02-ALB-Ingress-Basic.ymlx similarity index 100% rename from EKS/02-ALB-Ingress-Basic.yml rename to EKS/02-ALB-Ingress-Basic.ymlx diff --git a/EKS/03-ALB-Ingress-Basic.yml b/EKS/03-ALB-Ingress-Basic.yml new file mode 100644 index 00000000..033e8939 --- /dev/null +++ b/EKS/03-ALB-Ingress-Basic.yml @@ -0,0 +1,48 @@ +# 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 + namespace: default + labels: + app: app1-nginx + annotations: + kubernetes.io/ingress.class: "alb" + # 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/subnets: "subnet-052cb05835a3f5e5a,subnet-0873bc4a553aaeffe,subnet-014aadaa1e468fe62" + alb.ingress.kubernetes.io/manage-backend-security-group-rules: "true" + alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS13-1-2-2021-06 + alb.ingress.kubernetes.io/healthy-threshold-count: '2' + alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' + alb.ingress.kubernetes.io/load-balancer-attributes: access_logs.s3.enabled=true,access_logs.s3.bucket=zura-accesslog-637423293208-us-east-1,access_logs.s3.prefix=aws-alb-ingress-controller + alb.ingress.kubernetes.io/load-balancer-attributes: deletion_protection.enabled=true +spec: + #ingressClassName: my-aws-ingress-class # Ingress Class + rules: + - http: + paths: + - backend: + service: + name: ingress-ingress-nginx-controller + # name: app1-nginx-nodeport-service + port: + number: 80 + path: / + pathType: ImplementationSpecific #Prefix + + +# 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/EKS/ingress.yaml b/EKS/ingress.yaml new file mode 100644 index 00000000..06116705 --- /dev/null +++ b/EKS/ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ar-ingress + namespace: ar + annotations: + kubernetes.io/ingress.class: nginx + ingress.kubernetes.io/rewrite-target: / +spec: + rules: +# - host: waui-uat.apaas.unilever.genpact.com + http: + paths: + - path: "/" + pathType: ImplementationSpecific + backend: + service: + name: app1-nginx-nodeport-service + port: + number: 80 + From 608adec2c71999efdc9b84129404cd985b1ba42b Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:02:10 +0530 Subject: [PATCH 057/112] Update main.yml --- .github/workflows/main.yml | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7110dd8..af14b36e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,23 +1,24 @@ name: Hprofile Actions -on: workflow_dispatch # [push, workflow_dispatch] -#on: -# pull_request: -# types: -# - closed # Trigger the workflow when a pull request is closed +#on: workflow_dispatch # [push, workflow_dispatch] +on: + pull_request: + types: + - closed # Trigger the workflow when a pull request is closed env: AWS_REGION: us-east-1 jobs: -# If_merged: -# if: false # This condition effectively skips the job -# if: github.event.pull_request.merged == true # Check if the pull request was merged -# runs-on: ubuntu-latest # Specify the runner -# steps: -# - run: | -# echo The PR was merged # Print a message if the pull request was merged + If_merged: + # if: false # This condition effectively skips the job + if: github.event.pull_request.merged == true # Check if the pull request was merged + runs-on: ubuntu-latest # Specify the runner + steps: + - run: | + echo The PR was merged # Print a message if the pull request was merged Testing: + if: false # This condition effectively skips the job # needs: If_merged runs-on: ubuntu-latest steps: @@ -63,7 +64,7 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL BUILD_AND_PUBLISH: - if: false # This condition effectively skips the job +# if: false # This condition effectively skips the job needs: Testing runs-on: ubuntu-latest steps: @@ -86,8 +87,12 @@ jobs: region: ${{ env.AWS_REGION }} tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false - dockerfile: ./Dockerfile - context: ./ +# dockerfile: ./Dockerfile +# context: ./ + + run: | + docker build -t $registry:$repo:$tags . + docker push $registry:$repo:$tags - name: Update Image tag run: | 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 058/112] 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 277405e374c481752fcd3bafa793990910715f0c Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:11:11 +0530 Subject: [PATCH 059/112] Update main.yml --- .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 af14b36e..d3542248 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,8 +18,8 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: - if: false # This condition effectively skips the job -# needs: If_merged +# if: false # This condition effectively skips the job + needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout From dc492873562f5a70b5fbf094b78509c91267ba42 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:13:55 +0530 Subject: [PATCH 060/112] Update main.yml --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3542248..bbc1eb1e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,6 @@ env: jobs: If_merged: - # if: false # This condition effectively skips the job if: github.event.pull_request.merged == true # Check if the pull request was merged runs-on: ubuntu-latest # Specify the runner steps: From 531d1b3f402b8c8a80b0f4ddfeec5da633d493c3 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:16:24 +0530 Subject: [PATCH 061/112] Update main.yml --- .github/workflows/main.yml | 82 -------------------------------------- 1 file changed, 82 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbc1eb1e..afa2c075 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,6 @@ on: pull_request: types: - closed # Trigger the workflow when a pull request is closed - env: AWS_REGION: us-east-1 jobs: @@ -17,7 +16,6 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: -# if: false # This condition effectively skips the job needs: If_merged runs-on: ubuntu-latest steps: @@ -61,83 +59,3 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL - - BUILD_AND_PUBLISH: -# if: false # This condition effectively skips the job - 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: ./ - - run: | - docker build -t $registry:$repo:$tags . - docker push $registry:$repo:$tags - - - 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 - - - DEPLOY: - if: false # This condition effectively skips the job - 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 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 062/112] 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 873ef2193be3e6bdabef64979a3bb96c190d6e03 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:23:52 +0530 Subject: [PATCH 063/112] Update main.yml --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index afa2c075..55269dee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: + if: false # This condition effectively skips the job needs: If_merged runs-on: ubuntu-latest steps: @@ -59,3 +60,32 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL + BUILD_AND_PUBLISH: + # if: false # This condition effectively skips the job + # 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: ./ + run: | + docker build -t $REGISTRY:$REPOSITORY:$IMAGE_TAG . + docker push $REGISTRY:$REPOSITORY:$IMAGE_TAG 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 064/112] 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 9522d4a47481e3d27c9c906586f5606534418ada Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:27:15 +0530 Subject: [PATCH 065/112] Update main.yml --- .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 55269dee..b7a7e611 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: Testing: if: false # This condition effectively skips the job - needs: If_merged +# needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout 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 066/112] 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 42056fd6654415429e71582f290a1685cd428786 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:32:13 +0530 Subject: [PATCH 067/112] Update main.yml --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7a7e611..a2d1faa6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,8 +16,8 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: - if: false # This condition effectively skips the job -# needs: If_merged + # if: false # This condition effectively skips the job + needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout @@ -61,7 +61,8 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL BUILD_AND_PUBLISH: - # if: false # This condition effectively skips the job + # if: false # This condition effectively skips the job + needs: If_merged # needs: Testing runs-on: ubuntu-latest steps: 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 068/112] 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 00b28125f8a749e8919cb93c5fb76c01073b7a26 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:34:31 +0530 Subject: [PATCH 069/112] Update main.yml --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a2d1faa6..42f7ee89 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,6 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: - # if: false # This condition effectively skips the job needs: If_merged runs-on: ubuntu-latest steps: @@ -60,8 +59,8 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL + BUILD_AND_PUBLISH: - # if: false # This condition effectively skips the job needs: If_merged # needs: Testing runs-on: ubuntu-latest 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 070/112] 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 a190ec135accf98dc7df7ae6963025d07e8dc7b0 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:37:58 +0530 Subject: [PATCH 071/112] Update main.yml --- .github/workflows/main.yml | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42f7ee89..6502180e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,7 @@ jobs: needs: If_merged runs-on: ubuntu-latest steps: + - name: code checkout uses: actions/checkout@v4 @@ -59,33 +60,3 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL - - BUILD_AND_PUBLISH: - needs: If_merged - # 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: ./ - run: | - docker build -t $REGISTRY:$REPOSITORY:$IMAGE_TAG . - docker push $REGISTRY:$REPOSITORY:$IMAGE_TAG 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 072/112] 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 f11bba20e1a66307096da9c5630da017dbb1743a Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:43:13 +0530 Subject: [PATCH 073/112] Update main.yml --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6502180e..c9658f7f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: + if: false # This condition effectively skips the job needs: If_merged runs-on: ubuntu-latest steps: @@ -60,3 +61,46 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_URL }} #OPTIONAL + + BUILD_AND_PUBLISH: +# if: false # This condition effectively skips the job + needs: If_merged +# 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: ./ + run: | + docker build -t $registry:$repo:$tags . + docker push $registry:$repo:$tags + + - 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 From 291d7d8896cdf91cee235ae9764397651a270cad Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:47:22 +0530 Subject: [PATCH 074/112] Update main.yml --- .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 c9658f7f..c4794953 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: Testing: if: false # This condition effectively skips the job - needs: If_merged +# needs: If_merged runs-on: ubuntu-latest steps: From cac894cd1cb4bc8bb725495e8c04a2dca75d3fa5 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:51:04 +0530 Subject: [PATCH 075/112] Update main.yml --- .github/workflows/main.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4794953..4e4206fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,8 +16,7 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: - if: false # This condition effectively skips the job -# needs: If_merged + needs: If_merged runs-on: ubuntu-latest steps: @@ -38,7 +37,12 @@ jobs: - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 - + + Sonar: + if: false # This condition effectively skips the job + needs: Testing + runs-on: ubuntu-latest + steps: # Run sonar-scanner - name: SonarQube Scan run: sonar-scanner @@ -64,8 +68,7 @@ jobs: BUILD_AND_PUBLISH: # if: false # This condition effectively skips the job - needs: If_merged -# needs: Testing + needs: Testing runs-on: ubuntu-latest steps: - name: code checkout From 392967a56f596629bb8216b9ccb570e8e9caaeb4 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:52:05 +0530 Subject: [PATCH 076/112] Update main.yml --- .github/workflows/main.yml | 70 -------------------------------------- 1 file changed, 70 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e4206fb..6f4ed916 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,73 +37,3 @@ jobs: - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 - - Sonar: - if: false # This condition effectively skips the job - needs: Testing - runs-on: ubuntu-latest - steps: - # 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: -# if: false # This condition effectively skips the job - 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: ./ - run: | - docker build -t $registry:$repo:$tags . - docker push $registry:$repo:$tags - - - 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 From 0c2897b9bc70bf17cf2d9d9efd0a82dabc191c85 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:53:35 +0530 Subject: [PATCH 077/112] Update main.yml --- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f4ed916..360085ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,3 +37,44 @@ jobs: - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 + + 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: ./ + run: | + docker build -t $registry:$repo:$tags . + docker push $registry:$repo:$tags + + - 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 From c2e6e85a4affe8513d0820a3f43c992d0e9bc542 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:54:52 +0530 Subject: [PATCH 078/112] Update main.yml --- .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 360085ed..0d775bf7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,9 +63,9 @@ jobs: daemon_off: false # dockerfile: ./Dockerfile # context: ./ - run: | - docker build -t $registry:$repo:$tags . - docker push $registry:$repo:$tags +# run: | +# docker build -t $registry:$repo:$tags . +# docker push $registry:$repo:$tags - name: Update Image tag run: | From b3a8956dfa484786bfaeccf4c586cc3c1a632384 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:55:58 +0530 Subject: [PATCH 079/112] Update main.yml --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d775bf7..e851b4a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,36 @@ jobs: - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 + Sonar: + if: false # This condition effectively skips the job + needs: Testing + runs-on: ubuntu-latest + steps: + # 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: +# if: false # This condition effectively skips the job needs: Testing runs-on: ubuntu-latest steps: From a3e385974279191ab31ad09ea7499c8af378fb27 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:57:33 +0530 Subject: [PATCH 080/112] Update main.yml --- .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 e851b4a2..bfa74790 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: - name: Setup SonarQube uses: warchant/setup-sonar-scanner@v7 - Sonar: + Sonar: if: false # This condition effectively skips the job needs: Testing runs-on: ubuntu-latest From 20766e7b04c55e9996e1f8226aac886b214094dd Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:29:53 +0530 Subject: [PATCH 081/112] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bfa74790..4a19adba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ jobs: echo The PR was merged # Print a message if the pull request was merged Testing: + if: false # This condition effectively skips the job needs: If_merged runs-on: ubuntu-latest steps: @@ -68,7 +69,8 @@ jobs: BUILD_AND_PUBLISH: # if: false # This condition effectively skips the job - needs: Testing +# needs: Testing + needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout 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 082/112] 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 041bee4527f66ac10d46e16e5eee9b7aca63d7dd Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 20 Jun 2024 11:05:02 +0000 Subject: [PATCH 083/112] Update image to 62 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index d3313add..f86c826c 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:37 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:62 ports: - containerPort: 80 --- From 50910cdafc71f2d57cfbc6d403d3aef181d05325 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:46:47 +0530 Subject: [PATCH 084/112] Update main.yml --- .github/workflows/main.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a19adba..524d6887 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,17 +87,34 @@ jobs: 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 }} +# registry: ${{ secrets.REGISTRY }} +# repo: docker +# region: ${{ env.AWS_REGION }} +# tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false # dockerfile: ./Dockerfile # context: ./ # run: | # docker build -t $registry:$repo:$tags . # docker push $registry:$repo:$tags + + - name: Log in to Amazon ECR + run: | + aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com + - name: Build Docker image + run: | + docker build -t ${{ secrets.ECR_REPOSITORY }} . + + - name: Tag Docker image + run: | + docker tag ${{ secrets.ECR_REPOSITORY }}:latest 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} + + - name: Push Docker image to ECR + run: | + docker push 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} + + - name: Update Image tag run: | sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml From 6171a5a847a42038069cfc89524be3df8fc50996 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:47:28 +0530 Subject: [PATCH 085/112] 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 124f82a346d470585af62523945b75287764647f Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:49:09 +0530 Subject: [PATCH 086/112] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20b6204d..c3852aac 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 087/112] 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 2118dfff9c06eb6faa10a22fee41dea1eecc0c04 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:52:22 +0530 Subject: [PATCH 088/112] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3852aac..b7e48251 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -############## +### - JDK 11 - Maven 3 - MySQL 8 From 6da797ea3c717b15defef175f68f4037306d8497 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:55:13 +0530 Subject: [PATCH 089/112] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7e48251..20b6204d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -### +############ - JDK 11 - Maven 3 - MySQL 8 From 072fe3fcd15656ac6aeeac7b908b86d7bcec4a10 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:02:52 +0530 Subject: [PATCH 090/112] Update main.yml --- .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 524d6887..768f98cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,7 +108,7 @@ jobs: - name: Tag Docker image run: | - docker tag ${{ secrets.ECR_REPOSITORY }}:latest 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} + docker tag ${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} - name: Push Docker image to ECR run: | From 8f78717fb7af1032bc18ec597a1003b51c452289 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:03:36 +0530 Subject: [PATCH 091/112] 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 67a1f16780198054078b26d60612e53d101d90eb Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:04:37 +0530 Subject: [PATCH 092/112] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6753ceec..1dfdfc33 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -########## +########### - JDK 11 - Maven 3 - MySQL 8 From ff62bd2118c331b6015ca653522b0000f90439f9 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:05:30 +0530 Subject: [PATCH 093/112] 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 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 094/112] 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 b6002912628a39166d596b24b75149f60f1ad27c Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:17:25 +0530 Subject: [PATCH 095/112] Update main.yml --- .github/workflows/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 768f98cb..65aa209e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,6 +87,7 @@ jobs: with: access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} # registry: ${{ secrets.REGISTRY }} # repo: docker # region: ${{ env.AWS_REGION }} @@ -100,7 +101,7 @@ jobs: - name: Log in to Amazon ECR run: | - aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com + aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - name: Build Docker image run: | @@ -108,16 +109,16 @@ jobs: - name: Tag Docker image run: | - docker tag ${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} + docker tag ${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} - name: Push Docker image to ECR run: | - docker push 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} + docker push 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} - name: Update Image tag run: | - sed -i "s|image:.*|image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml + sed -i "s|image:.*|image: 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml - name: Commit changes run: | 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 096/112] 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 8bd5da1233455dd1def1614fe51566ff3082ccda Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:30:49 +0530 Subject: [PATCH 097/112] Update main.yml --- .github/workflows/main.yml | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65aa209e..c01fa6b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,38 +87,18 @@ jobs: with: access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} -# registry: ${{ secrets.REGISTRY }} -# repo: docker -# region: ${{ env.AWS_REGION }} -# tags: ${{ github.run_number }} #latest,${{ github.run_number }} +# aws-region: ${{ secrets.AWS_REGION }} + registry: ${{ secrets.REGISTRY }} + repo: docker + region: ${{ env.AWS_REGION }} + tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false -# dockerfile: ./Dockerfile -# context: ./ -# run: | -# docker build -t $registry:$repo:$tags . -# docker push $registry:$repo:$tags - - - name: Log in to Amazon ECR - run: | - aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - - - name: Build Docker image - run: | - docker build -t ${{ secrets.ECR_REPOSITORY }} . - - - name: Tag Docker image - run: | - docker tag ${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} - - - name: Push Docker image to ECR - run: | - docker push 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:${{ github.run_number }} - + dockerfile: ./Dockerfile + context: ./ - name: Update Image tag run: | - sed -i "s|image:.*|image: 637423293208.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml + sed -i "s|image:.*|image: 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml - name: Commit changes run: | 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 098/112] 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 a00319643323ba517278febca203852cfcf7ce7a Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 20 Jun 2024 12:03:13 +0000 Subject: [PATCH 099/112] Update image to 66 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index f86c826c..e7e57ee8 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:62 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:66 ports: - containerPort: 80 --- From 70df0aa33ee8fc1d2fb20001c36ed7028e2793ea Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:17:17 +0530 Subject: [PATCH 100/112] Update main.yml --- .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 c01fa6b4..e7c89292 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,7 +89,7 @@ jobs: secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # aws-region: ${{ secrets.AWS_REGION }} registry: ${{ secrets.REGISTRY }} - repo: docker + repo: ${{ secrets.ECR_REPOSITORY }} region: ${{ env.AWS_REGION }} tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false From 78548a0e42dc3ea709086051731c756ff784d211 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:17:43 +0530 Subject: [PATCH 101/112] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2722fcce..20b6204d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Prerequisites -############# +############ - JDK 11 - Maven 3 - MySQL 8 From 9b2d428e8cc5ac0e330282a1c40a93b515572940 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:20:17 +0530 Subject: [PATCH 102/112] 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 103/112] 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 From 9308e59b11bd58f4be1826e545d5ae69b126bffb Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Thu, 20 Jun 2024 12:52:24 +0000 Subject: [PATCH 104/112] Update image to 67 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index e7e57ee8..18818fef 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:66 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/docker:67 ports: - containerPort: 80 --- From 81b323a39acd4b13e5dde39d8ee6eaa55e2d2c8a Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:32:48 +0530 Subject: [PATCH 105/112] Update main.yml --- .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 e7c89292..ef482c74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,7 +89,7 @@ jobs: secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # aws-region: ${{ secrets.AWS_REGION }} registry: ${{ secrets.REGISTRY }} - repo: ${{ secrets.ECR_REPOSITORY }} + repo: ${{ secrets.REPOSITORY }} region: ${{ env.AWS_REGION }} tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false @@ -98,7 +98,7 @@ jobs: - name: Update Image tag run: | - sed -i "s|image:.*|image: 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/docker:${{ github.run_number }} |" ./java.yaml + sed -i "s|image:.*|image: 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.REPOSITORY }}:${{ github.run_number }} |" ./java.yaml - name: Commit changes run: | From dc663b2605bee7dfad90822039882f2269e9c7ff Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:37:14 +0530 Subject: [PATCH 106/112] Update main.yml --- .github/workflows/main.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef482c74..606e79c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,23 +1,11 @@ name: Hprofile Actions -#on: workflow_dispatch # [push, workflow_dispatch] -on: - pull_request: - types: - - closed # Trigger the workflow when a pull request is closed +on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 jobs: - If_merged: - if: github.event.pull_request.merged == true # Check if the pull request was merged - runs-on: ubuntu-latest # Specify the runner - steps: - - run: | - echo The PR was merged # Print a message if the pull request was merged - Testing: if: false # This condition effectively skips the job - needs: If_merged runs-on: ubuntu-latest steps: @@ -70,7 +58,6 @@ jobs: BUILD_AND_PUBLISH: # if: false # This condition effectively skips the job # needs: Testing - needs: If_merged runs-on: ubuntu-latest steps: - name: code checkout From 573c77ee86c2d3e79d5a7d3d9f533fafb3d2ab45 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 21 Jun 2024 10:09:00 +0000 Subject: [PATCH 107/112] Update image to 68 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index 18818fef..ff0797e0 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:67 + image: 637423293208.dkr.ecr.us-east-1.amazonaws.com/ar-automation-repo:68 ports: - containerPort: 80 --- From 983852382f2e1fe8f7cef5f15192aa14e94b9fac Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:27:27 +0530 Subject: [PATCH 108/112] Update main.yml --- .github/workflows/main.yml | 80 +++++--------------------------------- 1 file changed, 9 insertions(+), 71 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 606e79c3..61e30a00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,92 +1,30 @@ -name: Hprofile Actions -on: workflow_dispatch # [push, workflow_dispatch] +--- +name: AR-Controller Actions +on: workflow_dispatch env: AWS_REGION: us-east-1 -jobs: - - Testing: - if: false # This condition effectively skips the job - 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 - - Sonar: - if: false # This condition effectively skips the job - needs: Testing - runs-on: ubuntu-latest - steps: - # 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 - +jobs: BUILD_AND_PUBLISH: -# if: false # This condition effectively skips the job # 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 - + uses: actions/checkout@v4 - name: upload image to ECR - uses: appleboy/docker-ecr-action@master + uses: ar/docker-ecr-action@master with: access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# aws-region: ${{ secrets.AWS_REGION }} registry: ${{ secrets.REGISTRY }} - repo: ${{ secrets.REPOSITORY }} + repo: ${{ secrets.REPOSITORY }} region: ${{ env.AWS_REGION }} - tags: ${{ github.run_number }} #latest,${{ github.run_number }} + tags: ${{ github.run_number }} daemon_off: false dockerfile: ./Dockerfile context: ./ - - name: Update Image tag run: | - sed -i "s|image:.*|image: 637423293208.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.REPOSITORY }}:${{ github.run_number }} |" ./java.yaml - + sed -i "s|image:.*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.REPOSITORY }}:${{ github.run_number }} |" ./Deployment/controller-deployment.yaml - name: Commit changes run: | git config --global user.name ${{ secrets.USER_NAME }} From 604567654aa8f8411f8db75862551aecfc7c9775 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:31:05 +0530 Subject: [PATCH 109/112] Update main.yml --- .github/workflows/main.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61e30a00..bd95be98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,30 +1,40 @@ ---- -name: AR-Controller Actions -on: workflow_dispatch +name: Hprofile Actions +on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 -jobs: +jobs: BUILD_AND_PUBLISH: +# if: false # This condition effectively skips the job # needs: Testing runs-on: ubuntu-latest steps: - name: code checkout - uses: actions/checkout@v4 + 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: ar/docker-ecr-action@master + uses: appleboy/docker-ecr-action@master with: access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# aws-region: ${{ secrets.AWS_REGION }} registry: ${{ secrets.REGISTRY }} - repo: ${{ secrets.REPOSITORY }} + repo: ${{ secrets.REPOSITORY }} region: ${{ env.AWS_REGION }} - tags: ${{ github.run_number }} + tags: ${{ github.run_number }} #latest,${{ github.run_number }} daemon_off: false dockerfile: ./Dockerfile context: ./ + - name: Update Image tag run: | - sed -i "s|image:.*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.REPOSITORY }}:${{ github.run_number }} |" ./Deployment/controller-deployment.yaml + sed -i "s|image:.*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.REPOSITORY }}:${{ github.run_number }} |" ./java.yaml + - name: Commit changes run: | git config --global user.name ${{ secrets.USER_NAME }} From 78cff2b3e70200a044dd36c44edab79cc94f6708 Mon Sep 17 00:00:00 2001 From: KNarendra99599 Date: Fri, 21 Jun 2024 11:02:31 +0000 Subject: [PATCH 110/112] Update image to 70 --- java.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.yaml b/java.yaml index ff0797e0..67bd4226 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/ar-automation-repo:68 + image: 147214052833.dkr.ecr.us-east-1.amazonaws.com/ar-automation-repo:70 ports: - containerPort: 80 --- From 13c738ad128d8b4613044f44f78d401e7e7c44d7 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:17:53 +0530 Subject: [PATCH 111/112] Update main.yml --- .github/workflows/main.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd95be98..1f60d529 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,20 @@ on: workflow_dispatch # [push, workflow_dispatch] env: AWS_REGION: us-east-1 jobs: - BUILD_AND_PUBLISH: + Testing: # if: false # This condition effectively skips the job +# needs: Testing + runs-on: ubuntu-latest + steps: + - name: Debug Information + run: | + echo "Current Directory:" + pwd + echo "List of Files in the Current Directory:" + ls -la + shell: /usr/bin/bash -e {0} + BUILD_AND_PUBLISH: + if: false # This condition effectively skips the job # needs: Testing runs-on: ubuntu-latest steps: From 43ea76e5a0e3d5cc689e7fd95486d8ecd3ea2436 Mon Sep 17 00:00:00 2001 From: KNarendra99599 <82750843+KNarendra99599@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:19:29 +0530 Subject: [PATCH 112/112] Update main.yml --- .github/workflows/main.yml | 48 ++++---------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f60d529..6428a9b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,10 @@ +--- name: Hprofile Actions -on: workflow_dispatch # [push, workflow_dispatch] +on: workflow_dispatch env: AWS_REGION: us-east-1 -jobs: - Testing: -# if: false # This condition effectively skips the job -# needs: Testing +jobs: + Testing: runs-on: ubuntu-latest steps: - name: Debug Information @@ -15,42 +14,3 @@ jobs: echo "List of Files in the Current Directory:" ls -la shell: /usr/bin/bash -e {0} - BUILD_AND_PUBLISH: - if: false # This condition effectively skips the job -# 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 }} -# aws-region: ${{ secrets.AWS_REGION }} - registry: ${{ secrets.REGISTRY }} - repo: ${{ secrets.REPOSITORY }} - 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: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ secrets.REPOSITORY }}:${{ 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