From 69e88be1e50b74adaa36464a1b454eead966f62e Mon Sep 17 00:00:00 2001 From: princegupta1131 <114015020+princegupta1131@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:38:45 +0530 Subject: [PATCH] ED-4000 feat: Github actions instead of Jenkins-24 --- .github/workflows/ci-cd.yml | 40 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 54baa65a2f3..9ca2bc795d3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -87,13 +87,13 @@ jobs: # npm run test:ci # Install Sonar Scanner - - name: Install Sonar Scanner - run: | - cd /tmp - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip - sudo apt-get install -y unzip - unzip sonar-scanner-cli-5.0.1.3006-linux.zip - cd - + # - name: Install Sonar Scanner + # run: | + # cd /tmp + # wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip + # sudo apt-get install -y unzip + # unzip sonar-scanner-cli-5.0.1.3006-linux.zip + # cd - # # Run SonarScanner for frontend (Angular) # - name: Run SonarScanner for frontend @@ -106,13 +106,29 @@ jobs: # -Dsonar.host.url=https://sonarcloud.io \ # -Dsonar.organization=your_organization \ # -Dsonar.login=$SONAR_TO - - name: Run Sonar Scanner + # - name: Run Sonar Scanner + # env: + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # run: | + # /tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \ + # -Dsonar.projectKey=Sunbird-Ed_SunbirdEd-portal \ + # -Dsonar.sources=src/app/client/src \ + # -Dsonar.organization=sunbird-ed \ + # -Dsonar.host.url=https://sonarcloud.io \ + # -Dsonar.login=$SONAR_TOKEN + + # Install SonarScanner globally using npm + - name: Install SonarScanner + run: npm install -g sonarqube-scanner + + # Run SonarScanner in the specified directory + - name: Run SonarScanner env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - /tmp/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \ - -Dsonar.projectKey=Sunbird-Ed_SunbirdEd-portal \ - -Dsonar.sources=src/app/client/src \ - -Dsonar.organization=sunbird-ed \ + cd ~/src + sonar-scanner \ + -Dsonar.projectKey=your_project_key \ + -Dsonar.organization=your_organization \ -Dsonar.host.url=https://sonarcloud.io \ -Dsonar.login=$SONAR_TOKEN