From e27daa5f6df27ff26285833053a2bddd0214d8c3 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Sat, 3 Oct 2020 13:48:05 +0200 Subject: [PATCH] Update Jenkinsfile, deliver.sh, and 2 more files... --- Jenkinsfile | 49 +++++++++++++ jenkins/scripts/deliver.sh | 3 + pom.xml | 145 ++++++++++++++++++++----------------- seedjob.groovy | 22 ++++++ 4 files changed, 151 insertions(+), 68 deletions(-) create mode 100644 Jenkinsfile create mode 100755 jenkins/scripts/deliver.sh create mode 100644 seedjob.groovy diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..c9e6deb --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,49 @@ +#!/usr/bin/env groovy +// see https://jenkins.io/doc/book/pipeline/syntax/ + +pipeline { + environment { + MVN_SET = credentials('maven_settings') + } + agent { docker { image 'maven:3.6.3' } } + triggers { + pollSCM "* * * * *" + } + options { + timestamps() + ansiColor("xterm") + } + parameters { + booleanParam(name: "RELEASE", + description: "Build a release from current commit.", + defaultValue: false) + } + stages { + + stage("Build & Deploy SNAPSHOT") { + steps { + sh "mvn -s $MVN_SET -B deploy" + } + } + + stage("Release") { + when { + expression { params.RELEASE } + } + steps { + sh "mvn -s $MVN_SET -B release:prepare" + sh "mvn -s $MVN_SET -B release:perform" + } + } + stage('Deliver') { + steps { + sh './jenkins/scripts/deliver.sh' + } + } + } + post { + always { + deleteDir() + } + } +} diff --git a/jenkins/scripts/deliver.sh b/jenkins/scripts/deliver.sh new file mode 100755 index 0000000..121080f --- /dev/null +++ b/jenkins/scripts/deliver.sh @@ -0,0 +1,3 @@ +#!/bin/bash -e +echo "Delivered." + diff --git a/pom.xml b/pom.xml index e3cf9fc..a8a6178 100644 --- a/pom.xml +++ b/pom.xml @@ -1,70 +1,79 @@ - 4.0.0 - it.tdlight - tdlight-natives-osx-amd64 - 1.1.12 - TDLight Natives for OSX (amd64) - jar - - UTF-8 - - - - - publish-to-mchv - - - - mchv - MCHV Apache Maven Packages - https://mvn.mchv.eu/repository/mchv/ - - - - - publish-to-github - - - - github - GitHub TDLight Team Apache Maven Packages - https://maven.pkg.github.com/tdlight-team/tdlight-java - - - - - - - - - maven-clean-plugin - 3.1.0 - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.1 - - UTF-8 - 1.8 - 1.8 - - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 3.0.0-M1 - - - maven-deploy-plugin - 2.8.2 - - - + 4.0.0 + it.tdlight + tdlight-natives-osx-amd64 + 2.0.1-SNAPSHOT + TDLight Natives for OSX (amd64) + jar + + UTF-8 + + + + + mchv + MCHV Apache Maven Packages + https://mvn.mchv.eu/repository/mchv/ + + + mchv + MCHV Apache Maven Packages + https://mvn.mchv.eu/repository/mchv-snapshot/ + + + + scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-osx-amd64.git + scm:git:git@github.com:user/project.git + scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-osx-amd64.git + master + + + + + maven-clean-plugin + 3.1.0 + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.1 + + UTF-8 + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-release-plugin + 3.0.0-M1 + + + default + + perform + + + ${project.name}/pom.xml + + + + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 3.0.0-M1 + + + maven-deploy-plugin + 2.8.2 + + + diff --git a/seedjob.groovy b/seedjob.groovy new file mode 100644 index 0000000..3e7302d --- /dev/null +++ b/seedjob.groovy @@ -0,0 +1,22 @@ +#!/usr/bin/env groovy +// see https://jenkinsci.github.io/job-dsl-plugin/ and https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob + +pipelineJob("my-maven-lib") { + displayName("My Maven Lib") + definition { + cpsScm { + scm { + git { + remote { + url("...") + branch("*/master") + } + extensions { + localBranch("master") + } + } + } + scriptPath("Jenkinsfile") + } + } +}