Skip to content

Commit

Permalink
ci: Modify Jenkinsfile to add gradle build (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
nusuy committed Oct 11, 2023
1 parent 76bd21f commit b5e8b1b
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions ci/nusuy/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,62 @@
pipeline {
agent any

triggers {
githubPush()
}

tools {
gradle 'gradle'
}

stages {
stage('Print Hello') {
stage('Ready') {
steps {
echo '* * * SUCCESS: Hello Jenkins!'
echo 'Ready to build...',
git branch: "${env.BRANCH_NAME}",
credentialsId: 'Iv1.2497a20421157e60',
url: 'https://github.com/GDSC-CUBIX/EZPZ-Infra-Study'
}
}
}

/* Cleanup workspace */
post {
always {
deleteDir()
}
}
stage('Set application.properties') {
steps {
withCredentials([file(credentialsId: 'cubix-secret', variable: 'secret'),
file(credentialsId: 'cubix-secret-test', variable: 'testSecret')]) {
script {
sh 'cp $secret dev/nusuy/ext-search-batch/src/main/resources/application.properties'
sh 'cp $testSecret dev/nusuy/ext-search-batch/src/test/resources/application.properties'
}
}
}

post {
success: {
echo '[SUCCESS] Setting application.properties successed.'
}
failure: {
echo '[ERRPR] Setting application.properties failed.'
}
}
}

stage('Build'){
steps{
echo 'Build',
dir('dev/nusuy/ext-search-batch') {
sh 'chmod +x ./gradlew'
sh './gradlew clean build'
}
}

post {
success: {
echo '[SUCCESS] Build successed.'
}
failure: {
echo '[ERROR] Build failed.'
}
}
}
}
}

0 comments on commit b5e8b1b

Please sign in to comment.