-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Modify Jenkinsfile to add gradle build (#10)
- Loading branch information
Showing
1 changed file
with
50 additions
and
10 deletions.
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,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.' | ||
} | ||
} | ||
} | ||
} | ||
} |