Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
pipeline {
agent any

stages {
stage('Git clone') {
steps {
echo "cloning"
}
}
stage('Verify') {
steps {
echo "bokovi is verifying"
}
}

stage('Build') {
steps {
sh 'mvn compile'

}
}

// Running sonarqube
stage('Sonarqube test') {
environment {
scannerHome = tool 'ibt-sonarqube';
}
steps {
withSonarQubeEnv(credentialsId: 'SQ-student', installationName: 'IBT sonarqube') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}

stage('Run Test') {
steps {
sh 'mvn test'

}
}
stage('upload to artifactory') {
steps {
//sh 'mvn test'
configFileProvider([configFile('5d0920bc-97c5-4877-8aa4-2f61975fa9fc')]) {
sh 'mvn package'
}
}
}

stage ('OWASP Dependency-Check Vulnerabilities') {
steps {
dependencyCheck additionalArguments: '''
-o "./"
-s "./"
-f "ALL"
--prettyPrint''', odcInstallation: 'dependency-check'

dependencyCheckPublisher pattern: 'dependency-check-report.xml'
}
}

stage ('Deploy code to non-prod') {
steps {
script {
def remote = [name: 'IBT-Unix', host: '159.223.96.221', user: 'root', allowAnyHosts: true]
withCredentials([usernamePassword(credentialsId: " user-bokovi", usernameVariable: 'USERNAME',passwordVariable: 'PASSWORD')]) {
remote.password = PASSWORD
sshPut remote: remote, from: 'target/hello-maven-1.7-SNAPSHOT.jar', into: '/opt/tomcat/webapps/'
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ibt.app</groupId>
<artifactId>hello-maven</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.7-SNAPSHOT</version>

<name>hello-maven</name>
<!-- FIXME change it to the project's website -->
Expand Down
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonar.projectKey=nov15-cohort-project

sonar.java.binaries= target
sonar.host.url=https://sonarqube.ibtlearning.co/
2 changes: 1 addition & 1 deletion src/main/java/com/ibt/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
System.out.println( "Hello World!This is an update from Bokovi" );
}
}