From 9bc45958e2d9c8df7da8a4656e21085e96615e49 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 7 Apr 2019 14:01:10 -0400 Subject: [PATCH] maven java 11 fix + jenkins setup --- README.md | 5 +++++ jenkins/Jenkinsfile | 30 ++++++++++++++++++++++++++++++ jenkins/build.sh | 3 +++ jenkins/deploy.sh | 4 ++++ pom.xml | 9 +++++++++ 5 files changed, 51 insertions(+) create mode 100644 jenkins/Jenkinsfile create mode 100755 jenkins/build.sh create mode 100755 jenkins/deploy.sh diff --git a/README.md b/README.md index b763ece..9704fe3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # music-graph + +[![CodeFactor](https://www.codefactor.io/repository/github/simon987/music-graph-api/badge)](https://www.codefactor.io/repository/github/simon987/music-graph-api) +[![Build Status](https://ci.simon987.net/buildStatus/icon?job=music_graph_api)](https://ci.simon987.net/job/music_graph_api/) + + wip diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile new file mode 100644 index 0000000..247a3c3 --- /dev/null +++ b/jenkins/Jenkinsfile @@ -0,0 +1,30 @@ +def remote = [:] +remote.name = 'remote' +remote.host = env.DEPLOY_HOST +remote.user = env.DEPLOY_USER +remote.identityFile = '/var/lib/jenkins/.ssh/id_rsa' +remote.knownHosts = '/var/lib/jenkins/.ssh/known_hosts' +remote.allowAnyHosts = true +remote.retryCount = 3 +remote.retryWaitSec = 3 +logLevel = 'FINER' + +pipeline { + agent any + stages { + stage('Build') { + steps { + sh './jenkins/build.sh' + } + } + stage('Deploy') { + steps { + sshCommand remote: remote, command: 'rm -rf music_graph_api/target music_graph_api/deploy.sh' + sshPut remote: remote, from: 'target', into: 'music_graph_api' + sshPut remote: remote, from: 'jenkins/deploy.sh', into: 'music_graph_api/deploy.sh' + sshCommand remote: remote, command: 'chmod +x music_graph_api/deploy.sh && ./music_graph_api/deploy.sh' + } + } + } +} + diff --git a/jenkins/build.sh b/jenkins/build.sh new file mode 100755 index 0000000..b8e8dbf --- /dev/null +++ b/jenkins/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +mvn package \ No newline at end of file diff --git a/jenkins/deploy.sh b/jenkins/deploy.sh new file mode 100755 index 0000000..405c83d --- /dev/null +++ b/jenkins/deploy.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +ls +echo "todo" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 876edef..e8cbd5a 100644 --- a/pom.xml +++ b/pom.xml @@ -10,6 +10,15 @@ + + org.codehaus.mojo + versions-maven-plugin + 2.5 + + false + + + org.apache.maven.plugins 3.8.0