-
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
1 parent
b6ed34d
commit 3462353
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
jenkins.war | ||
sonarqube-9.9.0.65466 | ||
pep1/data/ | ||
## Ignore Visual Studio temporary files, build results, and | ||
|
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,57 @@ | ||
pipeline{ | ||
agent any | ||
tools{ | ||
maven "maven" | ||
} | ||
stages{ | ||
stage("Build JAR File"){ | ||
steps{ | ||
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/PodssilDev/ayudantias-tingeso-mingeso']]) | ||
dir("pep1"){ | ||
sh "mvn clean install" | ||
} | ||
} | ||
} | ||
stage("Test"){ | ||
steps{ | ||
dir("pep1"){ | ||
sh "mvn test" | ||
} | ||
} | ||
} | ||
stage("SonarQube Analysis"){ | ||
steps{ | ||
dir("pep1"){ | ||
sh "mvn sonar:sonar -Dsonar.projectKey=pep1 -Dsonar.host.url=http://localhost:9000 -Dsonar.login=sqp_fc56b1ba154bd3b0bf2aaa644210b01404548520" | ||
} | ||
} | ||
} | ||
stage("Build Docker Image"){ | ||
steps{ | ||
dir("pep1"){ | ||
sh "docker build -t johnserrano159/proyecto_docker ." | ||
} | ||
} | ||
} | ||
stage("Push Docker Image"){ | ||
steps{ | ||
dir("pep1"){ | ||
withCredentials([string(credentialsId: 'dckrhubpassword', variable: 'dckpass')]){ | ||
sh "docker login -u johnserrano159 -p ${dckpass}" | ||
|
||
} | ||
sh "docker push johnserrano159/proyecto_docker" | ||
|
||
} | ||
|
||
} | ||
} | ||
} | ||
post{ | ||
always{ | ||
dir("pep1"){ | ||
sh "docker logout" | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
mvn clean verify sonar:sonar -Dsonar.projectKey=pep1 -Dsonar.host.url=http://localhost:9000 -Dsonar.login=sqp_fc56b1ba154bd3b0bf2aaa644210b01404548520 | ||
mvn sonar:sonar -Dsonar.projectKey=pep1 -Dsonar.host.url=http://localhost:9000 -Dsonar.login=sqp_fc56b1ba154bd3b0bf2aaa644210b01404548520 |