Skip to content

Commit

Permalink
Update pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Manuel Medina committed Dec 19, 2024
1 parent ff74811 commit 416396c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/pipelineIC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ jobs:
REPO_NAME: ${{ github.event.repository.name }}
run: |
echo "Verificando si el proyecto $REPO_NAME existe en SonarCloud..."
response=$(curl -s -o /dev/null -w "%{http_code}" -u "$SONAR_TOKEN:" \
response=$(curl -s -o /dev/null -w "%{http_code}" -u "$TK_SONARCLOUD:" \
"https://sonarcloud.io/api/projects/search?projects=$REPO_NAME")
if [ "$response" -ne 200 ]; then
echo "El proyecto no existe. Creándolo en SonarCloud..."
create_response=$(curl -s -w "%{http_code}" -o /dev/null -X POST -u "$SONAR_TOKEN:" \
create_response=$(curl -s -w "%{http_code}" -o /dev/null -X POST -u "$TK_SONARCLOUD:" \
"https://sonarcloud.io/api/projects/create" \
-d "name=$REPO_NAME" \
-d "project=$REPO_NAME" \
-d "organization=devsecopsusach" \
#-d "organization=devsecopsusach" \
-d "visibility=public")
if [ "$create_response" -ne 201 ]; then
echo "¨Proyecto creado exitosamente (HTTP $create_response)."
fi
echo "Estableciendo la rama main como predeterminada..."
curl -s -f -X POST -u "$SONAR_TOKEN:" \
echo "Estableciendo la rama [feature-jm] [main] como predeterminada..."
curl -s -f -X POST -u "$TK_SONARCLOUD:" \
"https://sonarcloud.io/api/project_branches/rename" \
-d "name=main" \
-d "project=$REPO_NAME"
Expand All @@ -93,9 +93,9 @@ jobs:
echo "Realizando análisis inicial en la rama main..."
./gradlew sonarqube \
-Dsonar.projectKey=$REPO_NAME \
-Dsonar.organization=devsecopsusach \
#-Dsonar.organization=devsecopsusach \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.token=$SONAR_TOKEN \
-Dsonar.token=$TK_SONARCLOUD \
-Dsonar.branch.name=main
- name: Perform Branch Analysis
Expand All @@ -109,9 +109,9 @@ jobs:
echo "Realizando análisis en la rama actual: $BRANCH_NAME..."
./gradlew sonarqube \
-Dsonar.projectKey=$REPO_NAME \
-Dsonar.organization=devsecopsusach \
#-Dsonar.organization=devsecopsusach \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.token=$SONAR_TOKEN \
-Dsonar.token=$TK_SONARCLOUD \
-Dsonar.branch.name=$BRANCH_NAME
- name: Validate Quality Gate
Expand Down

0 comments on commit 416396c

Please sign in to comment.