Skip to content

Commit

Permalink
Added Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
616slayer616 committed Aug 16, 2019
1 parent f8550b1 commit 1f57f44
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
pipeline {

options {
timeout(time: 1, unit: 'HOURS')
}

agent {
docker {
image 'mxml/jdk-scp'
alwaysPull true
}
}

stages {

stage('build') {
steps {
sh 'java -version'
sh './gradlew clean assemble'
}
}
stage('Test') {
steps {
sh './gradlew check'
}
}

stage('Archive .jar'){
steps {
archiveArtifacts 'build/libs/**/*.jar'
}
}

stage('release'){
when{
branch 'master'
}
steps {
withCredentials([
file(credentialsId: 'gradle-properties ', variable: 'FILE_PROPERTIES'),
file(credentialsId: 'keyfile', variable: 'FILE_KEY')
]) {
sh 'cp $FILE_PROPERTIES .'
sh 'cp $FILE_KEY .'
}
sh './gradlew publish'
}
}
}

post {
success {
echo "Build successful"
}
always {
junit 'build/test-results/**/*.xml'
cleanWs()
}
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group 'org.padler'
version '1.0'
version '1.0.1'

sourceCompatibility = 1.8

Expand Down

0 comments on commit 1f57f44

Please sign in to comment.