From de87075f95727c27a65e5bdd2bc4b6bc307153d6 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:43:24 +0100 Subject: [PATCH 01/16] Delete .github/workflows directory --- .github/workflows/main.yml | 33 --------------------------------- 1 file changed, 33 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 8884b630..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: cicd-workflow to create docker image and upload into AWS ECR -on: - push: - branches: [ "master" ] -jobs: - job1: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '17' - - name: Build with Maven - run: mvn clean install - - name: Setup AWS ECR Details - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{secrets.AWS_REGION}} - - name: Login to Amazon ECR - id: login-pf-aws-ecr - uses: aws-actions/amazon-ecr-login@v1 - - name: Build and push Docker image - env: - ECR_REGISTRY: ${{ steps.login-pf-aws-ecr.outputs.registry }} - ECR_REPOSITORY: ${{secrets.REPO_NAME}} - IMAGE_TAG: ${{ github.sha }} - run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG From e83e58083acebfd1b871a64a1991e694d980fb54 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:44:46 +0100 Subject: [PATCH 02/16] Create build.yml --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..845c60e8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' From 6e1b8aab685ced06423e042a42fe774f4030745b Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:58:28 +0100 Subject: [PATCH 03/16] Update build.yml --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 845c60e8..77b3afcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,15 @@ + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - name: Clean up old workflow runs + uses: actions/purge-workflow-runs@v1 + with: + workflow-token: ${{ secrets.GITHUB_TOKEN }} + + + name: Build on: From c47984c090724fb7cf7e6f9c41cca738dc35d03d Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:59:59 +0100 Subject: [PATCH 04/16] Update build.yml --- .github/workflows/build.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77b3afcd..34d01bb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,4 @@ -jobs: - cleanup: - runs-on: ubuntu-latest - steps: - - name: Clean up old workflow runs - uses: actions/purge-workflow-runs@v1 - with: - workflow-token: ${{ secrets.GITHUB_TOKEN }} - - name: Build @@ -22,7 +12,7 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: self-hosted permissions: read-all steps: - uses: actions/checkout@v2 From e4249f91450aee17e19bca75be6ece613271788e Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 01:37:36 +0100 Subject: [PATCH 05/16] Create main.yml --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..845c60e8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' From c5229007957f6eeb496de58b62b3a235f2456f24 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 01:39:23 +0100 Subject: [PATCH 06/16] Delete .github/workflows directory --- .github/workflows/build.yml | 41 ------------------------------------- .github/workflows/main.yml | 39 ----------------------------------- 2 files changed, 80 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 34d01bb0..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ - - -name: Build - -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -jobs: - build: - name: Build - runs-on: self-hosted - permissions: read-all - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 845c60e8..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build - -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - permissions: read-all - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' From 42b7fbe1e937595effa4385a7ddbca1043398f85 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:06:48 +0100 Subject: [PATCH 07/16] Create main.yml --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..845c60e8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' From 577c45659fe3ec63525bdfa721d3f522fe20c394 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:08:36 +0100 Subject: [PATCH 08/16] 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 845c60e8..8f9b4b7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: self-host permissions: read-all steps: - uses: actions/checkout@v2 From c0bdc6d43bbaae8e57ef31c902e7dfff8647b587 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:21:45 +0100 Subject: [PATCH 09/16] 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 8f9b4b7e..845c60e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: jobs: build: name: Build - runs-on: self-host + runs-on: ubuntu-latest permissions: read-all steps: - uses: actions/checkout@v2 From 2aa93cf31436613e3bb94b9e3c962f49401101ad Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:24:53 +0100 Subject: [PATCH 10/16] Update main.yml From cf3732cbbcc3a009bf8570a0741f6975ca43d95a Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:41:33 +0100 Subject: [PATCH 11/16] Update main.yml From aa5759c0cec61a3c7d0f304e57c5bab9e5c7c250 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:44:08 +0100 Subject: [PATCH 12/16] Create emm.yml --- .github/workflows/emm.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/emm.yml diff --git a/.github/workflows/emm.yml b/.github/workflows/emm.yml new file mode 100644 index 00000000..845c60e8 --- /dev/null +++ b/.github/workflows/emm.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: read-all + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' From 57b0a380e55db2a2ae79902013577b766d8997b4 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:54:45 +0100 Subject: [PATCH 13/16] Update emm.yml --- .github/workflows/emm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/emm.yml b/.github/workflows/emm.yml index 845c60e8..e9301d5b 100644 --- a/.github/workflows/emm.yml +++ b/.github/workflows/emm.yml @@ -11,7 +11,7 @@ jobs: build: name: Build runs-on: ubuntu-latest - permissions: read-all + permissions: write-all steps: - uses: actions/checkout@v2 with: From c2804a38b6684499a262a98adebd86b2e3a0cd14 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 03:00:03 +0100 Subject: [PATCH 14/16] Update emm.yml --- .github/workflows/emm.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/emm.yml b/.github/workflows/emm.yml index e9301d5b..d50a43ed 100644 --- a/.github/workflows/emm.yml +++ b/.github/workflows/emm.yml @@ -1,3 +1,15 @@ +- name: Commit and push changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Your commit message" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + name: Build on: From df24eccc733f0bb1863cd657db38506bb5d5fcc3 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 03:00:54 +0100 Subject: [PATCH 15/16] Update emm.yml --- .github/workflows/emm.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/emm.yml b/.github/workflows/emm.yml index d50a43ed..0941bf24 100644 --- a/.github/workflows/emm.yml +++ b/.github/workflows/emm.yml @@ -1,13 +1,3 @@ -- name: Commit and push changes - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "Your commit message" - git push - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build From d371e2bc0bfc0ef4dc3a8132a53cc1aa11201da9 Mon Sep 17 00:00:00 2001 From: Ameloko Emmanuel <164350008+AmelokoEmmanuel@users.noreply.github.com> Date: Tue, 9 Jul 2024 03:03:23 +0100 Subject: [PATCH 16/16] Update emm.yml --- .github/workflows/emm.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/emm.yml b/.github/workflows/emm.yml index 0941bf24..8da499f2 100644 --- a/.github/workflows/emm.yml +++ b/.github/workflows/emm.yml @@ -1,5 +1,3 @@ - - name: Build on: @@ -13,11 +11,12 @@ jobs: build: name: Build runs-on: ubuntu-latest - permissions: write-all + permissions: + contents: write # Updated permission to write steps: - uses: actions/checkout@v2 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 # Ensure full git history is checked out - name: Set up JDK 17 uses: actions/setup-java@v1 with: @@ -39,3 +38,12 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=emmy -Dsonar.projectName='emmy' + - name: Commit and push changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Your commit message" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}