diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..7b55e10 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent any + stages { + stage('Test') { + steps { + script { + sh "sh ./gradlew clean test" + } + } + } + stage('Build') { + steps { + script { + sh "sh ./gradlew clean build" + } + } + } + stage('Deploy') { + steps { + script { + sh "sh deploy/nio17.sh" + } + } + } + } + post { + always { + script { + if (currentBuild.currentResult == 'FAILURE') { + step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "a.romanov@ulstu.ru", sendToIndividuals: true]) + } + } + } + } +} \ No newline at end of file diff --git a/deploy/nio17.sh b/deploy/nio17.sh new file mode 100644 index 0000000..d8845c9 --- /dev/null +++ b/deploy/nio17.sh @@ -0,0 +1,4 @@ +#!/bin/bash +bash ./gradlew assemble +scp -o StrictHostKeyChecking=no build/libs/fuzzy-controller-0.0.1-SNAPSHOT.jar root@192.168.1.129:/root/fuzzy-controller.jar +ssh root@192.168.1.129 "bash /root/run-fc.sh" \ No newline at end of file