Added release step to pom

This commit is contained in:
Ziver Koc 2017-10-26 17:17:49 +02:00
parent 750bb24f55
commit 15e884db95
2 changed files with 25 additions and 13 deletions

26
Jenkinsfile vendored
View file

@ -1,15 +1,14 @@
#!groovy #!groovy
// Jenkinsfile (Pipeline Script) // Jenkinsfile (Pipeline Script)
node { withMaven(jdk: "jdk8", maven: "m3.5", mavenLocalRepo: ".repository", mavenSettingsConfig: "639c4560-87b7-4502-bb3d-2c44845cd2b5") {
// Configure environment node {
env.REPO_URL = "repo.koc.se/zutil-java.git" //scm.getUserRemoteConfigs()[0].getUrl() // Configure environment
env.BUILD_NAME = "BUILD-" + env.BUILD_ID env.REPO_URL = "repo.koc.se/zutil-java.git" //scm.getUserRemoteConfigs()[0].getUrl()
env.BUILD_NAME = "BUILD-" + env.BUILD_ID
stage('Checkout') { stage('Checkout') {
git url: "https://" + env.REPO_URL git url: "https://" + env.REPO_URL
} }
withMaven(jdk: "jdk8", maven: "m3.5", mavenLocalRepo: ".repository", mavenSettingsConfig: "639c4560-87b7-4502-bb3d-2c44845cd2b5") {
stage('Build') { stage('Build') {
sh 'mvn clean compile' sh 'mvn clean compile'
@ -34,4 +33,13 @@ node {
sh 'mvn -DskipStatic -DskipTests deploy' sh 'mvn -DskipStatic -DskipTests deploy'
} }
} }
stage('Release') {
timeout(time: 1, unit: 'HOURS') {
input message: 'Deploy?', submitter: 'ziver'
node {
sh 'mvn --batch-mode -DskipStatic -DskipTests release:prepare release:perform'
}
}
}
} }

10
pom.xml
View file

@ -28,7 +28,7 @@
<scm> <scm>
<connection>scm:git:https://github.com/Ziver/zutil.git</connection> <connection>scm:git:https://github.com/Ziver/zutil.git</connection>
<developerConnection>scm:git:https://github.com/Ziver/zutil.git</developerConnection> <developerConnection>scm:git:https://repo.koc.se/zutil-java.git</developerConnection>
<url>https://github.com/Ziver/zutil</url> <url>https://github.com/Ziver/zutil</url>
</scm> </scm>
@ -111,6 +111,8 @@
<target>${java.version}</target> <target>${java.version}</target>
</configuration> </configuration>
</plugin> </plugin>
<!-- Plugins needed for deployment -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
@ -124,8 +126,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- Plugins needed for deployment -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
@ -167,6 +167,10 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose> <autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
</plugins> </plugins>
</build> </build>