1
0

Update Jenkinsfile, deliver.sh, and 2 more files...

This commit is contained in:
Andrea Cavalli 2020-10-03 11:34:56 +02:00
parent 6b58628f27
commit 7c0fea762c
4 changed files with 151 additions and 68 deletions

49
Jenkinsfile vendored Normal file
View File

@ -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()
}
}
}

3
jenkins/scripts/deliver.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash -e
echo "Delivered."

47
pom.xml
View File

@ -2,38 +2,31 @@
<modelVersion>4.0.0</modelVersion>
<groupId>it.tdlight</groupId>
<artifactId>tdlight-natives-linux-amd64</artifactId>
<version>1.1.21</version>
<version>2.0.1-SNAPSHOT</version>
<name>TDLight Natives for Linux (amd64)</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>publish-to-mchv</id>
<properties/>
<distributionManagement>
<repository>
<id>mchv</id>
<name>MCHV Apache Maven Packages</name>
<url>https://mvn.mchv.eu/repository/mchv/</url>
</repository>
<snapshotRepository>
<id>mchv</id>
<name>MCHV Apache Maven Packages</name>
<url>https://mvn.mchv.eu/repository/mchv-snapshot/</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>publish-to-github</id>
<properties/>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub TDLight Team Apache Maven Packages</name>
<url>https://maven.pkg.github.com/tdlight-team/tdlight-java</url>
</repository>
</distributionManagement>
</profile>
</profiles>
<scm>
<connection>scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-linux-amd64.git</connection>
<url>scm:git:git@github.com:user/project.git</url>
<developerConnection>scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-linux-amd64.git</developerConnection>
<tag>master</tag>
</scm>
<build>
<plugins>
<plugin>
@ -53,6 +46,22 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>${project.name}/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>

22
seedjob.groovy Normal file
View File

@ -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")
}
}
}