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."

145
pom.xml
View File

@ -1,70 +1,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>it.tdlight</groupId> <groupId>it.tdlight</groupId>
<artifactId>tdlight-natives-linux-amd64</artifactId> <artifactId>tdlight-natives-linux-amd64</artifactId>
<version>1.1.21</version> <version>2.0.1-SNAPSHOT</version>
<name>TDLight Natives for Linux (amd64)</name> <name>TDLight Natives for Linux (amd64)</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<profiles> <distributionManagement>
<profile> <repository>
<id>publish-to-mchv</id> <id>mchv</id>
<properties/> <name>MCHV Apache Maven Packages</name>
<distributionManagement> <url>https://mvn.mchv.eu/repository/mchv/</url>
<repository> </repository>
<id>mchv</id> <snapshotRepository>
<name>MCHV Apache Maven Packages</name> <id>mchv</id>
<url>https://mvn.mchv.eu/repository/mchv/</url> <name>MCHV Apache Maven Packages</name>
</repository> <url>https://mvn.mchv.eu/repository/mchv-snapshot/</url>
</distributionManagement> </snapshotRepository>
</profile> </distributionManagement>
<profile> <scm>
<id>publish-to-github</id> <connection>scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-linux-amd64.git</connection>
<properties/> <url>scm:git:git@github.com:user/project.git</url>
<distributionManagement> <developerConnection>scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-linux-amd64.git</developerConnection>
<repository> <tag>master</tag>
<id>github</id> </scm>
<name>GitHub TDLight Team Apache Maven Packages</name> <build>
<url>https://maven.pkg.github.com/tdlight-team/tdlight-java</url> <plugins>
</repository> <plugin>
</distributionManagement> <artifactId>maven-clean-plugin</artifactId>
</profile> <version>3.1.0</version>
</profiles> </plugin>
<plugin>
<build> <artifactId>maven-resources-plugin</artifactId>
<plugins> <version>3.0.2</version>
<plugin> </plugin>
<artifactId>maven-clean-plugin</artifactId> <plugin>
<version>3.1.0</version> <artifactId>maven-compiler-plugin</artifactId>
</plugin> <version>3.8.1</version>
<plugin> <configuration>
<artifactId>maven-resources-plugin</artifactId> <encoding>UTF-8</encoding>
<version>3.0.2</version> <source>1.8</source>
</plugin> <target>1.8</target>
<plugin> </configuration>
<artifactId>maven-compiler-plugin</artifactId> </plugin>
<version>3.8.1</version> <plugin>
<configuration> <groupId>org.apache.maven.plugins</groupId>
<encoding>UTF-8</encoding> <artifactId>maven-release-plugin</artifactId>
<source>1.8</source> <version>3.0.0-M1</version>
<target>1.8</target> <executions>
</configuration> <execution>
</plugin> <id>default</id>
<plugin> <goals>
<artifactId>maven-jar-plugin</artifactId> <goal>perform</goal>
<version>3.0.2</version> </goals>
</plugin> <configuration>
<plugin> <pomFileName>${project.name}/pom.xml</pomFileName>
<artifactId>maven-install-plugin</artifactId> </configuration>
<version>3.0.0-M1</version> </execution>
</plugin> </executions>
<plugin> </plugin>
<artifactId>maven-deploy-plugin</artifactId> <plugin>
<version>2.8.2</version> <artifactId>maven-jar-plugin</artifactId>
</plugin> <version>3.0.2</version>
</plugins> </plugin>
</build> <plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
</project> </project>

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