-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
90 additions
and
52 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
pipeline { | ||
agent { label 'Africa' } | ||
environment { | ||
FTP_SERVER = credentials('abreu_fpt_host') | ||
NUGET_SOURCE = 'credentials('private_nuget_uri') | ||
} | ||
|
||
stages { | ||
stage('Restore dependencies') { | ||
steps { | ||
echo 'Restoring project dependencies from NuGet...' | ||
sh 'dotnet restore KuhakuCentral.sln --source $NUGET_SOURCE' | ||
} | ||
} | ||
|
||
stage('SonarQube Analysis') { | ||
steps { | ||
script { | ||
def scannerHome = tool 'SonarQ-DotNET8' | ||
withSonarQubeEnv('SonarQ') { | ||
sh "dotnet ${scannerHome}/SonarScanner.MSBuild.dll begin /k:\"Kuhaku\"" | ||
sh "dotnet build" | ||
sh "dotnet ${scannerHome}/SonarScanner.MSBuild.dll end" | ||
} | ||
} | ||
} | ||
} | ||
|
||
stage('Compile project') { | ||
steps { | ||
echo 'Compiling the project...' | ||
sh 'dotnet build KuhakuCentral.sln --configuration Release' | ||
} | ||
} | ||
|
||
stage('Deploy to FTP') { | ||
steps { | ||
withCredentials([usernamePassword(credentialsId: 'abreu_kuhaku_test_ftp_credentials', usernameVariable: 'FTP_USER', passwordVariable: 'FTP_PASSWORD')]) { | ||
script { | ||
// Asumiendo que el directorio de salida se encuentra en bin/Release/net8.0/ | ||
def buildDirectory = 'bin/Release/net8.0/' | ||
if (fileExists(buildDirectory)) { | ||
echo "Directory exists. Deploying files to FTP..." | ||
sh """ | ||
lftp -e " | ||
set ssl:verify-certificate no; | ||
open ftp://$FTP_USER:$FTP_PASSWORD@$FTP_SERVER; | ||
mirror -R $buildDirectory .; | ||
bye; | ||
" | ||
""" | ||
} else { | ||
echo "Build directory not found. No files to upload." | ||
error "Deployment failed: Directory $buildDirectory not found." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters