diff --git a/jenkins-pipeline/deploy-pipeline b/jenkins-pipeline/deploy-pipeline new file mode 100644 index 0000000..301a6a3 --- /dev/null +++ b/jenkins-pipeline/deploy-pipeline @@ -0,0 +1,68 @@ +pipeline { + agent any + + stages { + stage('Prepare') { + agent any + + steps { + checkout scm + } + + post { + + success { + echo 'prepare success' + } + + always { + echo 'done prepare' + } + + cleanup { + echo 'after all other post conditions' + } + } + } + + stage('build gradle') { + steps { + sh './gradlew build' + + + sh 'ls -al ./build' + } + post { + success { + echo 'gradle build success' + } + + failure { + echo 'gradle build failed' + } + } + } + + stage('dockerizing'){ + steps{ + sh 'docker build . -t crypto/drop-the-bit' + } + } + + stage('Deploy') { + steps { + sh 'docker run -d -p 40005:40005 --name crypto_drop-the-bit crypto/drop-the-bit' + } + + post { + success { + echo 'success' + } + + failure { + echo 'failed' + } + } + } + } +} \ No newline at end of file