Skip to content

Commit

Permalink
updated deployment file
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuldeep-knoldus committed Jun 28, 2024
1 parent d3c9369 commit 3f529bd
Showing 1 changed file with 5 additions and 64 deletions.
69 changes: 5 additions & 64 deletions .github/workflows/gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# Setup for Java projects
# Set up JDK for Java projects
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

# Setup for Angular projects
# Set up Node.js for Angular projects
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '21'

# Build Java services
# Build Java and Angular projects
- name: Build Projects
run: |
SERVICE_NAMES=$(cat projects-changes-deploy.txt)
Expand All @@ -45,9 +45,9 @@ jobs:
if [ -d "$SERVICE_NAME" ]; then
cd $SERVICE_NAME
if [ "$SERVICE_NAME" == "blogs-analyzer-ui" ]; then
npm install
npm install && npm test && npm install -g sonarqube-scanner && npm run sonar
else
mvn clean install -B -V
mvn clean install -Psonar -B -V
fi
cd ..
fi
Expand Down Expand Up @@ -122,62 +122,3 @@ jobs:
cd ../..
fi
done
sonarcloud:
name: SonarCloud Analysis
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup for Java projects
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

# Setup for Node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '21'

# Sonar Analysis for Java projects
- name: Sonar Analysis for Java projects
run: |
SERVICE_NAMES=$(cat projects-changes-deploy.txt)
echo "Service Names: $SERVICE_NAMES"
for SERVICE_NAME in $(echo $SERVICE_NAMES | tr ',' ' '); do
echo "Processing Service: $SERVICE_NAME"
if [ -d "$SERVICE_NAME" ]; then
cd $SERVICE_NAME
if [ "$SERVICE_NAME" != "blogs-analyzer-ui" ]; then
mvn clean verify sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=nashtech -Dsonar.branch.name=master
fi
cd ..
fi
done
# Sonar Analysis for Angular projects
- name: Sonar Analysis for Angular projects
run: |
SERVICE_NAMES=$(cat projects-changes-deploy.txt)
echo "Service Names: $SERVICE_NAMES"
for SERVICE_NAME in $(echo $SERVICE_NAMES | tr ',' ' '); do
echo "Processing Service: $SERVICE_NAME"
if [ -d "$SERVICE_NAME" ]; then
cd $SERVICE_NAME
if [ "$SERVICE_NAME" == "blogs-analyzer-ui" ]; then
npm install
npm test
npm install -g sonarqube-scanner
npm run sonar
fi
cd ..
fi
done

0 comments on commit 3f529bd

Please sign in to comment.